pelesl
Member
Posted 6 months ago #
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.
pelesl
Member
Posted 6 months ago #
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
Member
Posted 6 months ago #
Google seems to recommend putting the code just above </body>. Is it being in the head making it impossible for google to find?
If google recommends it, than do it. We can conversate all day long all about it first, but why :)
pelesl
Member
Posted 6 months ago #
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?
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
Member
Posted 6 months ago #
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
Member
Posted 6 months ago #
SHEEESH! There is a bug with Google Analytics. I have several accounts with root domains (that is, your site is domain.com or 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
Member
Posted 6 months ago #
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
Member
Posted 5 months ago #
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.
joostdevalk
Member
Posted 1 month ago #
@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.