Adding Google Analytics code to landing pages
Copy link to clipboard
Copied
Hello,
I was wondering if you guys could help me out, please.
I was asked to add Google Analytics tracking code to some of the company landing pages.
The issue here is I don't have access to the top of the page (Header). I was provided with a locked template for header and footer created in php and I can only amend what's in the body.
could you please advise?
Many thanks,
Anna
Copy link to clipboard
Copied
Although Google advises to place the code as high as possible in the document, I always place it as low as possible. This is because it stops rendering the page while it connects to the Google server.
So, to answer your question, you can place it anywhere,
Edit: To be honest, I have stopped including the tracker in my documents, the only one that benefits ($$$) is Google. Most decent hosts have their own tools to do the same.
Copy link to clipboard
Copied
When you say landing pages, are these pages hosted within your site or pages hosted through a marketing solution like Marketo? If the latter, you typically don't edit the code often because either: 1. it's already included elsewhere via your application, or 2. the admins are needed to add it for you. Personally speaking if you need to add stuff I would work with your tech team to either add the code for you or look to use a tag manager like Google Tag Manager or Adobe Tag Manager so that you can include tracking or optimizing scripts without needing access to edit other parts of the source code.
Copy link to clipboard
Copied
Ask whoever is in charge of the Template to do this. The site verificiation meta tag goes inside the <head>. Tracking code <script> goes above the closing </body> tag.

