Have Google Analytics changed where to insert the tracking code?

6 replies
Hello guys,

Google Analytics are saying (I quote):

Once you find the code snippet, copy and paste it into the bottom of your content, immediately before the </body> tag of each page you are planning to track.

However - I have been told that Google have changed this - and in fact the code snippet now needs to be IMMEDIATELY BEFORE THE CLOSED HEAD TAG </head>

Would anyone know which is correct?

Thank you guys,

Jenn
#analytics #changed #code #google #insert #tracking
  • Can you say WordPress Plugin?
    {{ DiscussionBoard.errors[2475201].message }}
  • Profile picture of the author jennyuk
    Wow - it's amazing how unhelpful your answer was IMIQ.

    Surely someone with your number of posts - and a Senior Member - could help out us guys still trying to learn - without resorting to sarcasm?

    The true definition of knowledge is being gracious enough to share it with someone asking for help (ie me) - not using it as weapon against us.

    Your smug answer makes you the worst kind of teacher imaginable - the kind that says something like 'I know the answer but I'm not going to tell you'

    I'd like to add the GA code on a static html page using Dreamweaver - hence my question. It's not a WP site.

    If anyone else could let me know - as there is conflicting advice online - I'd be very grateful.

    Thank you,

    Jenn
    {{ DiscussionBoard.errors[2475225].message }}
    • Profile picture of the author pewsingh
      On my sites I always put it before the </head> in the header template and that way it catches every page on my site.
      Signature
      Natural Childbirth blog at raising-angels.com and spyware doctor and other spyware blockers review site at top-spyware-blockers.com
      {{ DiscussionBoard.errors[2475301].message }}
  • Profile picture of the author Nonny
    There are two different types of Google Analytics tracking code.

    The "traditional" tracking code goes just before the </body> tag.

    Adding the tracking code (traditional) - Analytics Help

    The "asynchronous" tracking code goes just before the </head>

    Set up the tracking code (asynchronous) - Analytics Help

    ETA: If you do decide to use a Wordpress plugin to place the tracking code, you need to carefully read the instructions to figure out which type of code it's designed to place on your site.

    You need to figure which type of code you are using and follow the appropriate instructions.
    {{ DiscussionBoard.errors[2475344].message }}
  • Profile picture of the author VegasGreg
    I just logged into Google and it now says:
    Copy the following code, then paste it onto every page you want to track immediately before the closing </head> tag.
    So, yes it appears this has changed from what it was originally.

    Always go to the source for actual true answers, typically everything else is just hearsay.

    As far as the "can you say WP Plugins". I would imagine those plugins now need to be updated. And it is much quicker to just paste the code into the theme than install, activate and then paste in the code.

    I didn't look at the previous code that was installed before the /body compared to the /head section, to see if it changed anything, by I would believe the original installed locations would still work and don't necessarily need to be changed.
    Signature

    Greg Schueler - Wordpress Fanatic... Living The Offline Marketing Dream...

    {{ DiscussionBoard.errors[2475360].message }}
  • Profile picture of the author D_M_S
    yes, they did change it recently because i think they are now using the asynchronous code across the board.
    Signature

    Looking for new affiliates for a penny auction web site -- please send me a PM

    {{ DiscussionBoard.errors[2475368].message }}

Trending Topics