Ever wonder how your websites' data in your analytics reports would be affected based on the placement of your analytics code on the page? Eric Enge and his team at Stone Temple Consulting have begun answering this question by testing the placement of the same analytics code within the top and bottom of a web page.


"With the help of Dennis Mortensen and the IndexTools team, we setup a more disciplined test. In this test, we placed Javascript both at the top and the bottom of the web pages for two sites (Tool Parts Direct and City Town Info).

The scripts were basically identical, except they fed their data into 2 different IndexTools accounts. This allowed us to more accurately measure the impact of placement on counting of visitors to the site. While we implemented the two scripts site wide, we focused our analysis on the Page Views to the home page."

It is a well known fact that data quality from web analytics isn't the greatest and can be very far off from 100%. Additionally, it should be trends that analysts should focus in order to gain a sense of the entire picture for you business' strategy.


Suggested Action(s)

"Our suggestion would be that if your page load is normally pretty snappy (total page load time of under 3 or 4 seconds), then keep your Javascript at the bottom, and remove any risk related to analytics vendor downtime. The small loss of data you see in this scenario should not be a significant factor in the value of your analytics data.

But, if your page load time is a bit slower (4 seconds or more), you may want to consider placing your analytics Javascript at the top of your web page. Your data loss will be larger, and also the nature of the lost data may start to differ."

May 19, 2008

Manoj has been in the Digital marketing industry for over 10 years with experience at some of Canada's largest companies: WestJet and Shaw Communications. Manoj first started in the search marketing industry with Enquiro Search Solutions, where he spearheaded web analytics, SEO Training and the development of cutting edge search marketing solutions for clients. Manoj is also an entrepreneur in the Mobile and Local Deals space.

Manoj is a Professional Speaker having participated at events such as Web Analytics Congress (Amsterdam), Emetrics, Web Analytics Xchange, WebTrends Engage, Internet Marketing Conference, Social Media Innovation Summit and Search Engine Strategies. He has also contributed to several leading online publications such as: Search Engine Land, Marketing Pilgrim, WebProNews, Search Engine Guide and the Web Analytics Assocation.

He founded and successfully sold Web Analytics World (a top 100 Digital Marketing Blog – http://adage.com/power150) and was voted #39th Most Influential Digital Marketer in North America – 2009 (see: www.Invesp.net)


It makes no different for me whether I use the analytics script at the top or bottom of my page. The results is the same. :-/

I am suprised that when you implemented the code on top and bottom that they didn't cancel each other out at least part of the time.

Most tracking systems have a one tag gets credit system and the last one seen gets credit. If you had 2 on the page the last one would always get credit unless the page wasn't allowed to fully load and then the top one would get credit.

Also, if you place tags in tables or within the body code that usually messes up the tracking too.

Comments closed after 30 days to combat spam.

Search Engine Guide > Manoj Jasra > Code Placement and Accuracy of Analytics