1 Star2 Stars3 Stars4 Stars5 Stars (10 votes, average: 5.00 out of 5)

Google Analytics Tracking Code Placement

The Google Analytics tracking code placement needs to be in the header. DO NOT believe those guys that tell you to put in before the closing body tag.</body>

Why Should I Place The Google Analytics Code In The Header?

The Google Analytics code loads in order with the rest of the code. So if you have your code at the bottom of your web pages it will NOT load until the last part of your page loads.

Tip: Click on images to make them larger. If you find anything wrong on this page or need further assistance please comment below or contact me. 🙂

Why Is It Bad To Load The Google Analytics Code at The End Of The Webpage?

Because it will take longer to report a visit and you will not get accurate data. Sometimes if the code is at the end of a webpage the reader has already read everything that you had to say and clicked off of the page and Google Analytics reports it at 00:00 time and your bounce rate goes through the roof!

Look at this screen shot below in the column that reads Avg. Session Duration. Those numbers should be a lot bigger.

Subscribe To My YouTube Channel:

Google Analytics Tracking Code Placement


I did a test where I put the analytics code to the  in my sidebar and footer. Then I went to the real time data and it was upwards of 2 minutes before Google started tracking my visit. This is bad because as you see it will increase my bounce rate!

Putting your Google Analytics code at the bottom of the webpage can make you miss visits altogether because the script will never get a chance to load!

Where is the best place to put the Google Analytics Code?

WordPress, Joomla, Drupal or any other Dynamic content management system should have a header.php file. You want to look for the opening body tag <body> and place the code directly after it!

If you are on Blogger or on any other template system you want to be sure that you get the code in the same place, right after the opening <body> tag. Google Analytics tracking code placement is important because by it we determine what to write about so don’t play around. get the code where it needs to be!

Google Analytics Tracking Code Placement was last modified: May 22nd, 2015 by Maximus Mccullough

Please like, share and subscribe.

Advanced Programming Made Easy

I hope you enjoyed the article. If I was able to help you please consider a tip for the content.

One Time Tip

more tips

Reoccuring Tips


Cool People Share:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.