Can't get google analytics tracking code to work (3 posts)

  1. onandoffthegringotrail
    Posted 2 years ago #


    I have inserted the google analytics tracking code in full into every page and post of my blog but Google Analytics gives 'Status: Tracking not installed' on the 'Tracking Info' tab. What's happening?

    My site is onandoffthegringotrail.com and the code looks like this:

    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

    ga('create', 'UA-40******-2', 'onandoffthegringotrail.com');
    ga('send', 'pageview');


  2. graphicgeek
    Posted 2 years ago #

    This should be inserted into the footer.php file or the header.php file of the theme, that way you don't have to insert it on every post and page. I suspect something may be getting garbled by the content editor, since the script is causing a javascript error.

    Alternately, you can use a plugin: http://wordpress.org/plugins/google-analytics-for-wordpress/

  3. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    I do honestly recommend a plugin vs. adding code directly to the site.

    It's simpler and effective. The plugins do not add weight to your website, and you don't need to remember to copy over any code if you change themes in the future. I actually use the one recommended by @graphicsgeek on all of my sites.

Topic Closed

This topic has been closed to new replies.

About this Topic