Installing Google Analytics tracking code on Landing Pages
-
Hello,
I have my landing pages located on a separated subdomain (LP.example.com).
I've created a new property in Google Analytics for that subdomain. My question is:
- where do I have to place the GA tracking code ? in the header ? before I close the tag or before I close the tag ?
I have another issue: I've placed the GA Tracking code on some pages in the way below:
in the body tag of that Landing page HTML Code I added this line: -
Hi Joni, thanks for your question! You've received some great replies! Did any of them answer your question? We'd love an update, thanks.
Christy
-
Hi Folks,
My apologies the recommendation only applies to Google Tag Manager (GTM)
https://developers.google.com/tag-manager/quickstart
I would never recommend anyone to use just GA/UA with scripts unless they are a developer and even if they are they should recognise the advantage of using GTM. With GTM there is no need for putting GA/UA scripts directly on the page/site unless its eCommerce or something very cutsom. Anywho thats my two cents, I hope Joni got sorted.
Dave
-
I agree stick with what Google says keep it in the header
- Paste your snippet (unaltered, in it’s entirety) into every web page you want to track. Paste it immediately before the closing tag.
If your website uses templates to generate pages, enter it just before the closing tag in the file that contains the the section.
- Paste your snippet (unaltered, in it’s entirety) into every web page you want to track. Paste it immediately before the closing tag.
-
Hi!
I'm sorry to disagree with you Dave, but actually, in most cases you need to place your analytics script just before the tag to be more accurate.
You can see the set up for GA tracking code in Analytics Help: https://support.google.com/analytics/answer/1008080?hl=en.
Also, if you want more background information, here the guys from Luna Metric have written an excellent article that details where to put the GA snippet and why.
Hope it helps!
-
Hi Joni,
The GA tag ALWAYS goes just inside of your opening body tag () and it differs again for eCommerce with the page needing to be loaded before events are reported to GA. Try the search terms "ga tag body" and you will get a few links that will make it crystal clear where it goes.
I would also strongly advise you to look at using Google Tag Manager (GTM) over a standard analytics setup especially if you don't have a development background.
I wouldn't be overly concerned with Wappalyzer not seeing the GA code but its not a good sign. I would recommend using the Google Analytics debugger for Chrome/Firefox to do any debugging of GA tags.
Dave
-
You want to place the regular Google analytics JavaScript in right above the body tag.
If it is the new universal Google analytics I believe it must be in the head to work properly. However when you are actually copying the code they give you a you can read the directions and then what I suggest doing is going over whatever part of the site they reference for instance if it states this tag must be in between the
<header>and <header>tags copy the tag, then use the command + F on a Mac or control +F on a PC in order to find the tag that they suggest you place it above or under. It will either be in the header or above the body tag.
Hope this helps,
Thomas</header> </header>
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Google Analytics: How to Track Blog Traffic that Enter the Purchase Funnel?
I've been trying to figure this out for awhile, but I have had no luck. The current ecommerce store that I work for is trying to find out how to track how many people coming in via the blog are converting/buying. The site lives on Magento and the blog is on wordpress and they both use the same Google Analytics code. Site URL: http://website.com/ Blog URL: http://website.com/blog Is there anyway to do this so you can see which landing pages are driving conversions? If not, Is it possible to set up Google Analytics to show conversions and revenue coming from people who enter through blog directory?
Reporting & Analytics | | Erik-M0 -
Google Analytics Goals - Different Domain
Hi, We currently need to setup a goal that involves a different domain. Any guidance would be greatly appreciated. more info: the checkout process is redirected to a secure.domain Just let me know if I can provide any additional info that may helpful.
Reporting & Analytics | | opusvo0 -
No option to connect to google analytics!
I figured it out had to click on the pencil icon. On GA looks like this http://orlandocouponsfree.com - http://orlandocouponsfree.comUA-9313894-1orlandocouponsfree.combut url is http://www.orlandocouponsfree.com/Is this an issue? When I tried to connect to google analytics yesterday. There was a connection issue with Moz & GA. I refreshed page hoping it would help. Now it won't let me choose domain. When I view campaign it says I should connect properties. [IMG]http://i.imgur.com/jkJ0ZdF.png[/IMG] I click link and get to this page which doesn't provide my an option. http://analytics.moz.com/settings/campaign/89561.117561 [IMG]http://i.imgur.com/jkJ0ZdF.png[/IMG]
Reporting & Analytics | | touristips0 -
Google Analytics & Omniture Discrepancies
I am seeing a significant difference between my traffic numbers in Google Analytics and Omniture (Omniture has significantly more). I do not expect them to report exactly the same numbers but these are just too far off. Any idea why that is, or which one I should trust more? Thanks!
Reporting & Analytics | | emediaSEO0 -
Google Analytics - Tracking a Goal from 1 Domain to Another
Hi there, been combing this page for some answers - https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite but can't seem to figure it out. Scenario - Site A Site B Currently have 2 different GA accounts set up on each. Is it possible to Track a Goal that happens on Site B, that comes from Site A - In Site A Reports? So say, Site A has a Newsletter, directing them to Site A but promoting Site B - i'd like to track the effectiveness of the newsletter. Site A is running a white label of Site B service. Thoughts? Cheers
Reporting & Analytics | | IsHot0 -
Google Analytics Title tag vs landing page visitors numbers
Hi folks, Just wondering if anyone has any ideas as to why im getting different results in Google analytics. I'm using the Content Efficiency Analysis Report from http://www.kaushik.net which is absolutely awesome. When I search via my title tag I get 920 Unique Visitors over the month but when I search via the landing page URL with the same title tag I get 28. Any ideas to why their should be such a difference. I've also noticed that on that page i'm also getting a Rel Cononical TRUE using a site crawl. Any ideas are much appreciated
Reporting & Analytics | | acs1110 -
Google Analytics
Hi I added one google analytics account with a third party business as an admin, and I accidentally shared all the accounts of my clients. So this business have access to all my google analytics account. How do I remove them as an admin of all the GA accounts except the one they need? A step by step process is welcomed 🙂 Thank you,
Reporting & Analytics | | Ideas-Money-Art0 -
Google Keyword Tool versus Google Analytics
Hi I'm trying to establish a methodology to best show the gap between potential and realised organic keyword traffic. To obtain potential keyword traffic I'm using the Google Adwords keyword tool to derive local monthly search volumes for exact keyword matches. To get the realised data I'm using Google Analytics. However, to get the I'm confused as to which is the best way of getting a comparable metric from Google Analytics (GA). I was using custom reports and the 'organic searches' metric. However, this provides different values to a standard report selecting non-paid search in the default advanced segments. What is the best report/metric in GA to use for both organic and paid search volumes that would be comparable to the Google Adwords keyword tool. Thanks Neil
Reporting & Analytics | | mccormackmorrison0