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>
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 to sub domains
Hi, I have a site xyz.com and two separate sites on sub domains xyz.com/abc and xyz.com/def. What's the best way to go about with GA such that I can get all the data in the same place. Should I use the GA code for xyz.com on sub domains as well? Or should I create separate profiles?
Reporting & Analytics | | mayanksaxena0 -
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 -
I have just found that Google Analytics are suggesting everyone upgrade to their new Universal Analytics, will this affect my MOZ account? should I do it now or wait till they default the updgrade?
Here is the link from google developers https://developers.google.com/analytics/devguides/collection/upgrade/guide#overview
Reporting & Analytics | | Jacquie_AegisSafety0 -
How to setup Google Analytic goals that go to different urls?
I would like to setup my form's conversion rate as a goal in my Google Analytics account. The goal is complete when someone enters their information and hits submit. Logically, the "Thank you page" would be the destination url for the goal. My problem is that the thank you page is outside of the primary domain, for example, my site is: SiteExampl.com but the Thank you URL is thankyouurl.com Is it possible to setup a goal like this? If so how. Thanks in advance!
Reporting & Analytics | | christinarule0 -
Google analytics reality check?
Looking back over a 9 month period tracking analytics with getclicky my site showed a 29% bounce rate, with only about 1/4 of visitors spending 1 minute or less on my site. I've recently implemented GA (removed old clicky code) and although traffic is strong, my site now shows a bounce rate of about 82%. Engagement stats also show that 82% of visitors spend between 0-10 seconds on my site. My site is built on Wordpress and the GA tracking code wasn't placed directly in the footer, my developer built a field in the admin area to insert the UA number which automatically adds the code to all pages. I've checked the code and the tracking seems to appear on all pages. I took a look at AW Stats. It corroborates GA and says that 80% of visitors are spending 0-30 seconds on the site. Potential issues/clues: browser tests show small loading problems in Internet Explorer 7,8,9 (the phone number at the top of the header loads on the wrong side of the page) and major issues in Internet Explorer 6 (site doesn't load at all in IE 6). The thing is no one who uses IE 6 is coming to the site. Second, the site gets a grade of C in YSlow, it's not lightning fast at the moment. GA is showing average page load of 2.4 seconds, but don't think either of these issues should cause an 82% 0-10 seconds engagement number. My site is content rich/focused with very minimal advertising. Content is accessible well above the fold. My question: Does the fact that AW Stats and GA agree mean that those numbers are accurate, or is there a bug I should be looking for? How to explain the clicky numbers?
Reporting & Analytics | | JSOC0 -
Google Analytics | REAL TIME
So I noticed today that there is now Real Time Data: http://analytics.blogspot.com/2011/09/whats-happening-on-your-site-right-now.html and I cannot figure out how to access this.
Reporting & Analytics | | joseph.chambers1 -
Google Analytics - Intelligence Custom Alerts
When you add an intelligence custom alert does it look at the history and backdate issues? I've added a few custom alerts, even basic ones like my homepage gets 5 views, create an alert. I either need to wait a day or something is going wrong. Cheers.
Reporting & Analytics | | Seaward-Group0 -
New Google Analytics Site Speed tool and excel
Hello, I was wondering if there is a good tool or method to pull the new Google Analytics Site Speed data into excel and use this document to track site speeds on a weekly basis for multiple clients? Any good articles or how-to's would be awesome!
Reporting & Analytics | | Hakkasan0