Google analtyics code placement
-
I saw that Google suggests the analytics code be in the , will this effect the page load if it is in here? Also, is it a problem to have it in the body?
-
if you are placing the Asynchronous tracking code in the head you will be fine. I would keep the code in the head, I don't really see any good reason for putting the code in the body.
-
If you use the Asynchronous tracking code it shouldn't cause any noticeable lag in page load times
Placing the code inside the body tag won't validate through W3C. There's really no reason I know of to place it anywhere else.
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
-
Unsolved Google Analytics (GA4) recommendations for SEO analysis?
Guides on Moz and elsewhere mostly refer to Google Analytics' Universal Analytics (UA). However, UA is being replaced with GA4, and the interface, options, and reporting are very different. Can you recommend a clear, thorough, and effective walkthrough of how to set up useful SEO reports in GA4? Is there a simple tool you recommend that will help connect historical data from UA to GA4 when GA4 is the only option available? If there's no simple tool, what values do you recommend retaining from UA for effective historical reporting? How would you use them? At minimum for reporting, I'd want to show month-to-month changes and year-to-year changes (in percentages and in real numbers) for the following: all site visits all organic visits organic visits as a percentage of all site visits organic visits that led to a specific goal completion organic visits that led to any goal completion Thanks in advance for your help!
Reporting & Analytics | | Kevin_P1 -
Track buttons in Google Tag Manager
Hi! First question: I am wondering if it's possible to track two buttons with the same code in Google Tag Manager without changing the code? There are different page URL's.. Second one: My tags are displayed in Google Analytics as 'events'. When I put the events in 'goals', the number of times it fired differs from my events. Someone who can help me with this issue?
Reporting & Analytics | | conversal0 -
Finding missing GA code
Hi guys, I'm trying to find missing Google Analytics code on pages using Screaming Frog. I usually use Screaming Frog to find pages missing GA tracking but sometimes i encounter websites like: http://tinyurl.com/qjbdyxr which don't contain the GA code in the html (even though there is a GA code on the page). I'm guessing its located somewhere else and pulled in from somewhere? Any suggestions? Cheers,
Reporting & Analytics | | jayoliverwright
Chris0 -
Google Cookies
Without Google Analytics, how would we be able to identify visitors who are from Google Organic? What's the cookie?
Reporting & Analytics | | AMHC0 -
Linking My Google analytics with visual.ly
Hello, I have a quick question: Is it secure and safe to link my Google Analytics account with Visual.ly here's the link: https://create.visual.ly/graphic/google-analytics I want to create easy-to-understand report from Google Analytics and if you have any experience with this service can you share it with me please. Thanks.
Reporting & Analytics | | JonsonSwartz0 -
Goal Totals in Google Analytics
How do I get a cumulative tally of all the goals reached in google analytics? I've been using the percentages currently, but I was wondering if there was an easier way. Thanks
Reporting & Analytics | | OOMDODigital0 -
Goal tracking in Google Analytics
Hi folks I read from various sources that if you setup goals in Google Analytics each of these goals can only be fulfilled once per visit. Also some sources suggesting that only one goal from each goal group can be fulfilled per visit. On our site we have a goal for external links since this provides value to partners. Some users do open an external link in a new tab, then come back to the main site. Any further goal completions would then not get tracked. Since we apply a result based payment model for our work this means we are literally loosing money. Anyone has official info from Google on this? Can it be configured? How long is a visit? Thanks a million and have a great day. Fredrik
Reporting & Analytics | | Resultify0 -
Using Google Analytics for tracking statistics of the HOMEpage
Hello, Lets say I have a website with the HOMEpage being http://www.page.com. There are various subpages e.g. http://www.page.com/page1, http://www.page.com/page2, http://www.page.com/page3 . Now when I use Google Analytics it gives me all kind of statistics for the subpages shown as /page1 /page2 /page3 ... (relative path). According to this pattern the HOMEpage should be just "/". Unfortunately I can't find "/" in any statistics. Is this normal? Thanks in advance
Reporting & Analytics | | guitarslinger0