Place of Google Analytics javascript tracking code

366 views
Skip to first unread message

anurad...@daffodilsw.com

unread,
Oct 22, 2013, 1:35:16 AM10/22/13
to digital-analyti...@googlegroups.com
Hi I want to ask why it is recommended to place Google Analytics javascript tracking code just before the closing of </head> tag?? not elsewhere


Analytics Academy Course Staff

unread,
Oct 23, 2013, 4:35:07 PM10/23/13
to
Good question! 

This is so the JavaScript fires off before the rest of the page loads. This way, you know that a page was requested even if something stops the rest of the page from loading. If you had the tracking code in a footer, for example, and the footer never loads, you'd miss the hit that would otherwise come from that page. It also makes sure that the tracking code doesn't interfere with anything else that's trying to load. 

Hope this helps!

Best, 

Analytics Academy Staff

Zain Siddiqui

unread,
Oct 31, 2013, 2:45:59 AM10/31/13
to digital-analyti...@googlegroups.com
I want to implement the tracking code on my wordpress blog but don't know how to access the source code of the theme to be able to paste the analytics code in the header. What do i do?
Reply all
Reply to author
Forward
0 new messages