Support » Plugins and Hacks » Analytics does not detect the code

  • Resolved pelesl

    (@pelesl)


    I installed this into two different blogs I have on a dreamhost account. I can verify that if I go to the blogs and view the source, the google analytics code is there (at the bottom of the <head> section), but google analytics does not detect the code; it says “tracking unknown”. I’ve tried all the tricks I could find, such as deactivating and reactivating the plugin, making sure I’m not logged in as administrator on the blog (I also told the plugin to go ahead and track the administrator), trying it from a different IP address, etc. The site http://sitescanga.com shows that the code is properly installed.

Viewing 12 replies - 1 through 12 (of 12 total)
  • pelesl

    (@pelesl)

    Oh, I also made sure there was an http:// in front of the URL inside my google analytics profile. The only other thing worth mentioning is that the blogs are not on a root domain, that is, they are mydomain.com/blog1 and mydomain.com/blog2. This shouldn’t be a problem, right? Any ideas?

    pelesl

    (@pelesl)

    Google seems to recommend putting the code just above </body>. Is it being in the head making it impossible for google to find?

    whooami

    (@whooami)

    Member

    If google recommends it, than do it. We can conversate all day long all about it first, but why 🙂

    pelesl

    (@pelesl)

    whooami: the plugin inserts the code in the blog pages for me. That’s the whole point. Do you know of a way to tell it to put it somewhere else?

    whooami

    (@whooami)

    Member

    oh, Im sorry. My bad for not realizing you were using a plugin.

    if it were me, I would ditch the plugin, and edit my footer.php, putting in the code right before the closing </body> tag 🙂

    pelesl

    (@pelesl)

    whooami: Interesting…. I disabled the plugin, and then did as you said, pasting the code from google analytics into the footer.php file. Google still says it can’t find it, and I confirmed by viewing the source that it is in fact there. Does anyone knows if it still collects data even if the “status is unkown”?

    pelesl

    (@pelesl)

    SHEEESH! There is a bug with Google Analytics. I have several accounts with root domains (that is, your site is domain.com or http://www.domain.com) which work fine with the URL typed in without the http:// and without the trailing slash. However, it seems that if the URL of your site is not a root domain, for example, www.domain.com/SiteIWantToTrack, it will not work if you type in http://www.domain.com/SiteIWantToTrack, you must add the trailing slash, like this: http://www.domain.com/SiteIWantToTrack/

    In the end, I’m not using the plugin, but I suspect there is no difference.

    erick_paper

    (@erick_paper)

    Having a plugin for this simple functionality is exactly why many WP blogs are so horridly slow. Just get the JS and toss it in your footer template for crying out loud.

    If you want a folder in your site to be tracked, then yes, a trailing slash is the way to do. The same file without a trailing slash could be a *page* on the site (without a file extension, which is common these days) and not a folder.

    One problem I had getting this working was on the Google Analytics end. Make sure of the following:

    • URL in Google Analytics includes http://www.yourdomain.com/ (with training slash)
    • Default page is set to “index.php” in Google Analytics

    After doing these two (very obvious, but overlooked) things, Analytics started tracking my site without issue.

    @erick_paper: The plugin actually takes care of stuff like outbound link tracking automatically, also the overhead of adding a piece of code through a hook is negligible, compared to loads of other plugins.

    @joostdevalk Without reading the instructions properly I attempted to paste the whole of the JS code into the box for the site ID – duh. Once I found that it wasn’t working I changed back to the site ID but Google Analytics still wasn’t picking up the tracking code. I then did what @erick_paper suggested and Analytics now works fine. I appreciate there are a few things I’m going to be missing doing it this way so I’m wondering if you could give me a pointer about fixing up my blunder. Thanks in advance.

    peterfletcher38: understandable, would love to know why the plugin didn’t work for you though 🙂

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Analytics does not detect the code’ is closed to new replies.