Having difficulty installing my tracking code for Google Analytics

by 8 replies
10
So I have the code from google analytics.

I first pasted it into one of the option boxes which came with my theme (the7) but then checked the status from google and it said the status is "tracking not installed"

I then opened Editor, and in the header.php, i pasted the code before </head>. I checked the status again and it's still not being detected.

Does any one know what I'm doing wrong?
#website design #analytics #code #difficulty #google #installing #tracking
  • Hi trickshot,

    You're not using CloudFlare, Varnish, W3TC or similar are you? It may be that the cache is just out of date and needs a flush.

    Otherwise - view the source of your site and see what it looks like. if you're using chrome, browse to "view-source:http://yourdomain" and see if you can spot the code you added.

    Also, themes can have multiple header files, so it's possible the one you edited isn't the "right" one. If it were me, I would just use a plugin like Yoast's one to add the tracking code.. that way if you change/update themes it won't break

    Cheers,
    Michael
    • [ 1 ] Thanks
    • [1] reply
    • Thank you very much, your response was very helpful. I've just installed Yoast and it seems to be working.

      Do you advise also installing W3TC to help my site load faster? I've not installed it yet but I just checked it out and it seems like it would make my website more efficient. Will it affect the Yoast tracking with Google Analytics?
  • Google always recommends putting the code at the bottom of a webpage. In your case, that would be inside the footer.php file right before the </body> tag.
    • [1] reply
    • Hi nmwf,

      Care to share your source for this? GA code is asynchronous.. it's advantageous for it to be in the head, as it is more likely to record a visit if someone has a fast trigger finger.

      From the horses mouth:

      https://support.google.com/analytics...answer=1008080

      Cheers,
      Michael
      • [1] reply
  • Hi trickshot,

    Unless you're already experiencing performance problems, I wouldn't bother myself - I've found caching plugins to be a bit hit and miss - Some of my sites have been faster as a result, some slower.. they can sometimes break css/javascript too.

    It shouldn't affect Yoast/Google Analytics - that should be fine

    Cheers,
    Michael
    • [ 1 ] Thanks
  • Before it went async, Google did recommend it be in the footer.

Next Topics on Trending Feed