Hello,

Module is enabled, code on all pages and configured. Google analytics admin page reports "Tracking code not detected". Check status page reports "Tracking Not Installed".

www.bobin.nl

Please advise.......

Thanks.

Comments

bobin’s picture

Title: Tracking Code Not Detected » Tracking Code Not Detected.
hass’s picture

Status: Active » Fixed

Disable local caching of ga.js. Google cannot verify if the file is locally cached... after successful verification you can turn the feature on.

hass’s picture

ASIDE - if you have read the description next to the checkbox you would be aware about this.

sbydrupal’s picture

I have the same problem.

- Installed the latest 6x-2.2 module
- Did not turn on the caching
- As a precaution, turned off also the Views Cache, Performance Cache,
- Tracking is not recognized in Google Account

Did not pass the javascript code as the module indicates it is automatically recognized.

Any feedback will be appreciated.

Thanks

sbydrupal’s picture

Solved. Just as reference for future users:

I had deleted the "Closure Region" related entries in page.tpl.php, which caused the Google Analytics Module not enter the javascript code to the footer region. Added Closure entries back and Google recognized it.

Thanks for the module.

talisker’s picture

Another fix for reference:

I just had this same problem, turned out to be the access content permission. I have it off for anonymous users so you need to login to view content, but it seems it was also hiding the analytics javascript from google.

Allowing anonymous users access to content fixed this for me.

Dragolin’s picture

Status: Fixed » Active

I have a similar problem, google does not recognise the tracker installed, I have the local caching disabled

Code in my footer:

<script type="text/javascript">
<!--//--><![CDATA[//><!--
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
//--><!]]>
</script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
try{var pageTracker = _gat._getTracker("UA-9756216-2");pageTracker._trackPageview();} catch(err) {}
//--><!]]>
</script>

Google code should be:

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._trackPageview();
} catch(err) {}
</script>

Any reason why it is not generated as it should be?

hass’s picture

Status: Active » Fixed

It's the same - it's only XHTML strict save and this is how core works. Clear your caches.

Dragolin’s picture

thx you were right, it works now!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pimousse98’s picture

I'm having the same issue: cache was cleared, and view source for a logged out user shows the Javascript (same as posted by Dragolin above). My anonymous users don't have "view content" rights, but shouldn't that be a problem since the Javascript is shown? I could turn it on briefly if that allows the tracking to be checked by Google, but I can't keep it on for any extended period of time and would rather not if I can avoid it.
Thanks

hass’s picture

I would turn my webserver OFF if I do not like to have users on my site. *shaking the head*

pimousse98’s picture

Err... sorry I wasn't clear, this site is used to post and share files for a company team. So all content should be password-protected. The statistics that Drupal keeps are ok, but incomplete, and I thought Google Analytics would help.

I ended up turning on anonymous access for a minute and then off and Google seemed to detect the JS, however I'm still waiting for data to appear (it's been a day), and I'm wondering if anyone had issues with tracking password-protected content.

hass’s picture

Google cannot verify your site if it's only for logged in users... I have never tested this myself...

pimousse98’s picture

FYI - I did the temporary "anonymous user can access content" enabling, long enough for GA to pick it up - it showed it as detected, then now (it's been a little less than a day since "verification") it shows "receiving data" as the status (I have disabled anonymous content access now). There are still no page views shown, so I can't confirm it's working yet. I will post again to update, as other people might be interested in making this work as well.
Thanks :)

hass’s picture

I hope you are aware that by default many pages of logged in users - like all "admin" pages + all edit pages and so on are not logged.

ailgm’s picture

Unfortunately I've got this problem too -- I've tried all the suggestions on this thread to no avail.

My site is www.americae-commerce.com

Suggestions would be appreciated.

eikici’s picture

I got the same problem. Module set up as suggested, but no GA script detected... the "closure region" php code print just a newline.

ailgm’s picture

Status: Closed (fixed) » Needs work

I am still at a loss on how to fix this. I've now tried disabling every optional module except Google Analytics and switching to a standard theme. Nothing seems to make a difference.

hass’s picture

Status: Needs work » Fixed

http://www.americae-commerce.com/ tracks users. Nothing to do.

hass’s picture

Status: Fixed » Closed (fixed)
ailgm’s picture

Status: Closed (fixed) » Needs work

Comment withdrawn. The problem was an incorrect ID.

ailgm’s picture

Status: Needs work » Closed (fixed)
mox386’s picture

Clearing the cache solved the problem for me.

spidersilk’s picture

Status: Closed (fixed) » Active

I'm having this problem too, and I've tried every fix I've seen posted. Specifically:

  • I've verified that the tracking code IS appearing on the pages, by viewing source, so it isn't a theme issue.
  • I made sure that caching of the tracking script is not enabled.
  • I've verified that the tracking ID is correct.
  • The site is not restricted to logged-in users or anything like that -- all content is accessible to anonymous users.
  • I've cleared cached data via the button on the performance page.
  • I tried moving the code from the footer to the header via the advanced settings, in case another module's Javascript was interfering (and verified that it was appearing on the page in this case too).

But thus far nothing has worked. The site is http://www.carolyndallmandownes.com/ -- does anyone have any ideas as to what else I might be able to try?

hass’s picture

Status: Active » Closed (fixed)

I see no reason why this should not work on your site and the site currently tracks data. Maybe you are too impatient. Otherwise you may like to try v3.x

dalegrebey’s picture

Title: Tracking Code Not Detected. » Google Analytics Not Working - <?php print $closure; ?> is blank.

I have Google Analytics enabled and print $closure right before my close body tag. When I view source, however, I do not see the tracking code, simply a non break space.

I've:

  • Verified that the module is enabled /settings/googleanalytics
  • Cleared Cache on /settings/performance page
  • Disabled all caching entirely
  • Verified that my Google property ID is correct
  • Verified that print $closure is indeed in the appropriate place in my template

Any idea as to why the $closure code would not produce the appropriate Google Analytics Tracking Code to be verified when I view page source?

Thanks,
Dale

hass’s picture

Title: Google Analytics Not Working - <?php print $closure; ?> is blank. » Tracking Code Not Detected.
Jazz Li’s picture

I had this problem, and I resolved it by adding a trailing "/" to the hostname in the profile, in Google Analytics' settings.

"example.com" FAIL
"example.com/" SUCCESS

baby.hack’s picture

Google Analytics is telling me that I don't have the Tracking Code Installed.

I've got a multi-site Drupal 7 single install. My default site and two others have this module installed. All three sites have the print $page_bottom in an html.tpl.php file in the themes they each use. Each one has the module set to put the code in footer. I have separate GA codes for all three sites, which have separate domains all parked on the same server. Codes are correct. Content is viewable by any users.

My default site seems to have the code at the end of the body. This appears to be the same code that Google Analytics says to put in each page. Google Analytics says there is no tracking code installed.

The other two sites don't have the script, but they do have a

tag, which is crammed full of code. They also aren't recognized by Google. Help? EDIT: Hmmm... Google Analytics Tracking Code still says Tracking Status: Tracking Not Installed, but when I switched to the "Old Version" of Google Analytics, I saw that it said Recieving Data, and that there are statistics there. Apparently there is a bug on the Tracking Code tab in the New Version of Google Analytics, but I am indeed getting stats now. (I had to move the code to the header in one site, for some reason, even though the $page_bottom was part of the theme.)
PeterG’s picture

Adding a trailing slash as described in #29 fixed the issue for me.

hass’s picture

You mean on http://www.google.com/analytics/ in the profile settings? Sounds like an Apache configuration bug on your webserver. Just try to run your site URL without a slash and see; if page loading fails. I guess it will fail...

branram’s picture

Issue summary: View changes

I am having this issue as well. We are using the Universal Analytics and have installed 7.x-2.x-dev as this was the only version stated to work with UA... is there some known issue with tracking not begin detected by Google?