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
-
Tracking Product Codes
Hey Mozzers, We are improving our B2B site by adding product codes to headings & meta information etc to gain some traction ranking for our own products and those supplied by others when searched for by product code. Almost immediately we are hitting the top half of the first page for most of these and seeing some nice results. We would like to track our placement for these product codes in google but feel this would be a waste of our Moz Keyword limit and we really dont need to check them once a week, just one a month or so. Has anybody got any methods of tracking our ranking for a a big list of keywords say once a month which isn't too labour intensive? Many Thanks
Reporting & Analytics | | ATP0 -
UA Codes on Multiple Sites
Someone came in and set up Google Analytics code on one of our clients' sites before we got there and it is showing data from an outside website that the code is also on. Does anyone know the best way to find out what that other site is so we can remove this code from both sites? Thanks as always MOZ friends!
Reporting & Analytics | | ReunionMarketing0 -
Google Webmasters DNS error
Hi, In my webmaster tools I have a yellow triangle stating that there is a DNS error that is preventing Google crawling my sites. The site is indexed and I have checked fetch as Google and that seems ok but the triangle is still there every time I check it. The whois sites all have the correct information and point to Hostgator who I am using. I have contacted them and they said everything seems ok. Should I just carry on as normal with my link building as the site is indexed or investigate even further? Cheers, Stuart
Reporting & Analytics | | stuart420 -
Localhost:4444 Showing Up in Google Analytics
Hello All, Lately in my Google Analytics account I have noticed a referral source labelled: localhost:4444 The number of visits is really high from this source, but I have no idea (no clue!) what it actually means. Can anyone shed some light on what this is about? Should I be creating some sort of filter to screen out this as a referral source (assuming it is not legitimate)? Many thanks in advance. Cheers!
Reporting & Analytics | | Robert-B0 -
Wordpress + Google Analytics = Pulling My Hair Out
Hey Mozzers, Quick question for you- I have analytics set-up for a personal site I run and I know, verifiably it's receiving traffic, however, whenever I access my Google Analytics dashboard, it says I've had zero visits. Interestingly, today I had a colleague check the site from a foreign country and I could see the page views (within 15 minutes), however, I could not get any information about the site viewer. I have verified that the Analytics profile is 'receiving data' (which it is) and my Google Webmaster Tools is not reporting any issues? Finally, I went ahead and updated my profile so that it is pulling from 'www.mydomain.com' instead of 'mydomain.com', I don't know if that'll make any difference, but likewise, I didn't want to go and create the 'little kid in the elevator' analogy, where I'm just pressing a bunch of buttons just because they're there. So the only changes I've made thus far were deactivating Yoast's SEO plug-in and manually placing the GA code in the header and updating the 'Website's URL' in the profile settings tab of GA from 'mydomain.com' to 'www.mydomain.com'. With that, I am stumped and praying another one of the esteemed Mozzers out there may be able to help me resolve this. Any thoughts?
Reporting & Analytics | | NiallSmith0 -
Google Webmaster Dropped Traffic
Hi Guys, I've recently implemented a new site design with a new url architecture etc.. I set up Google Webmaster tools in early March and went live with the new site on 2nd April. Since the 6th April (4 days after going live) I've notice a drop in impressions from 15,000 - 28,000 per day to 3,500 - 5,500 per day. Now I'm kind of new to this, so after I cleaned up after my initial panic, I checked impressions vs. clicks. Impression are down 44% and clicks 31%. Not bad I thought but then again what if I dropped so far off the radar I never made an impression. 1. So first question: Are the number of impressions of a keyword independant of ranking. So if I rank #3,445,234th will I still see impressions listed but avg. position reflect #3,445,234? So while I was thinking of asking these questions I checked Google Analytics for which I have just over 3 years of metrics. Compared to the past; overall traffic and organic traffic are the same if not 10-20% better. 2. So second: Am I missing something? Its a resort website so easter just ended and you would expect the traffic to match and drop, but such a sudden and dramitic drop in Webmaster Tools impressions does not match Google Analytics. Infact Organic traffic climbed slightly. Can anyone offer any insight? Thanks, Adam
Reporting & Analytics | | NaescentAdam0 -
Best Practices For Google Analytics
Does anyone have any recommendations or resources for best practices in using Google Analytics. Specifically, as they relate to SEO and managing and monitoring several websites (i.e. registering/managing multiple accounts vs. master account, etc).
Reporting & Analytics | | Gyi0