Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is the same problem as http://drupal.org/node/66899 that was closed. All I get in my HTML is:
_uacct = "UA-402254-1";urchinTracker();My site is http://riscy.biz
Obviously there is something different with my site and other sites but it must be common to this guy http://drupal.org/node/66899
It looks like they got theirs working by manually adding the code into the HTML. The Adsense module works, what could be causing the problem with Analytics?
I'm running 4.7.2, could another module or theme be conflicting?
Comments
Comment #1
Riscy CreditAttribution: Riscy commentedI think it could be related to this line:
This exists on my site but not on the example site given in the closed bug.
Comment #2
Riscy CreditAttribution: Riscy commentedForgot to use code tags
Comment #3
Riscy CreditAttribution: Riscy commentedI fixed it in a dodgy way. For some reason Drupal is ignoring the drupal_set_html_head call so I chucked all the code in the Return:
Now Google is happy, but the script reference isn't in the section so probably classed as bad HTML.
Comment #4
TerrenceLP CreditAttribution: TerrenceLP commentedHey it works! Amen, thanks again
Comment #5
nicholasThompsonMine was the opposiete way around - The header was working, but not the return. I just put everything in the header (as google suggest you do)
Comment #6
moshe weitzman CreditAttribution: moshe weitzman commentedworking for me. google suggests putting the js link in the HEAD and the tracking script code at end just before so to my eyes, the module is working as designed.
Comment #7
dsoundmn CreditAttribution: dsoundmn commentedbased on the code method that google's system suggests the modification of the function in the following fashion should be a bit more ideal.
Comment #8
buddaYou're right, as mentioned on http://www.google.com/support/analytics/bin/answer.py?answer=26908&hl=en
All the JavaScript code should be in the footer. Funnily the Google Analytics sight itself doesn't follow this rule. Have committed the fix to the 4.7 & CVS branches.
Comment #9
(not verified) CreditAttribution: commented