How Do I Add Google Analytics Code in...

User 271657 Photo


Ambassador
3,816 posts

Seems there's two different versions of the analytics code. Old style goes before </body> and the newer asynchronous version goes before the </head>.


Set up the tracking code (asynchronous)
BEFORE YOU BEGIN: If you're already tracking your website using an older tracking snippet, first remove the older snippet. You can use a text or HTML editor on the file that contains the snippet and save it if you have customizations you want to add back in later. (Looking for the traditional snippet? See this article.)[/quote]

http://www.google.com/support/analytics … wer=174090

So everyone has it right!:D
I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams)
https://www.callendales.com
User 187934 Photo


Senior Advisor
20,271 posts

I have one site that wouldn't verify using the Analytics tool in VSD and it wouldn't verify placing it in a HTML box/ Body HTML. I got it to verify by placing the code to the head of the page.
So my recommendation is to put it wherever it works.;)
BTW, I'm using the new version.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 271657 Photo


Ambassador
3,816 posts

Another question about this...
I'm using this for the first time. VSD still puts it right after the opening <body> tag, so I inserted it with the Edit Header option instead. Does it matter if it's not the last thing before the closing head tag?
I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams)
https://www.callendales.com
User 187934 Photo


Senior Advisor
20,271 posts

Try verifying it and see. Like I said I've had to do it both ways.:/
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.