Title: Analytics does not detect the code
Last modified: August 19, 2016

---

# Analytics does not detect the code

 *  Resolved [pelesl](https://wordpress.org/support/users/pelesl/)
 * (@pelesl)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/analytics-does-not-detect-the-code/)
 * 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](http://sitescanga.com)
   shows that the code is properly installed.

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

 *  Thread Starter [pelesl](https://wordpress.org/support/users/pelesl/)
 * (@pelesl)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/analytics-does-not-detect-the-code/#post-695650)
 * 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?
 *  Thread Starter [pelesl](https://wordpress.org/support/users/pelesl/)
 * (@pelesl)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/analytics-does-not-detect-the-code/#post-695651)
 * Google seems to recommend putting the code just above </body>. Is it being in
   the head making it impossible for google to find?
 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/analytics-does-not-detect-the-code/#post-695652)
 * If google recommends it, than do it. We can conversate all day long all about
   it first, but why 🙂
 *  Thread Starter [pelesl](https://wordpress.org/support/users/pelesl/)
 * (@pelesl)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/analytics-does-not-detect-the-code/#post-695654)
 * 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](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/analytics-does-not-detect-the-code/#post-695656)
 * 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 🙂
 *  Thread Starter [pelesl](https://wordpress.org/support/users/pelesl/)
 * (@pelesl)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/analytics-does-not-detect-the-code/#post-695657)
 * 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”?
 *  Thread Starter [pelesl](https://wordpress.org/support/users/pelesl/)
 * (@pelesl)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/analytics-does-not-detect-the-code/#post-695658)
 * 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](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](https://wordpress.org/support/users/erick_paper/)
 * (@erick_paper)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/analytics-does-not-detect-the-code/#post-695663)
 * 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.
 *  [averyfisher](https://wordpress.org/support/users/averyfisher/)
 * (@averyfisher)
 * [18 years, 2 months ago](https://wordpress.org/support/topic/analytics-does-not-detect-the-code/#post-695960)
 * 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/](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.
 *  [Joost de Valk](https://wordpress.org/support/users/joostdevalk/)
 * (@joostdevalk)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/analytics-does-not-detect-the-code/#post-696015)
 * [@erick_paper](https://wordpress.org/support/users/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.
 *  [peterfletcher38](https://wordpress.org/support/users/peterfletcher38/)
 * (@peterfletcher38)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/analytics-does-not-detect-the-code/#post-696040)
 * [@joostdevalk](https://wordpress.org/support/users/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](https://wordpress.org/support/users/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.
 *  [Joost de Valk](https://wordpress.org/support/users/joostdevalk/)
 * (@joostdevalk)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/analytics-does-not-detect-the-code/#post-696041)
 * 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.

 * 12 replies
 * 6 participants
 * Last reply from: [Joost de Valk](https://wordpress.org/support/users/joostdevalk/)
 * Last activity: [17 years, 6 months ago](https://wordpress.org/support/topic/analytics-does-not-detect-the-code/#post-696041)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
