I have installed this module once earlier with success. I can't get it to work on another site, though.

What I've done:

activated the module in "modules"
updated the settings in "settings->google analytics" with my accountinfo

But it doesn't appear in the html-source of my pages.

What may be usefull to know: I use flexinode and the template node-flexinode-X.tpl.php that comes with flexinode. Maybe there goes something wrong? But what?

Thanks in advance!

Comments

budda’s picture

Does your theme implement the print $footer; ? The module uses hook_footer(0 to add the javascript to the end of your pages.

Pibu’s picture

Ah, thanks! I missed the closuretag. I added this to my page.tpl.php just above the -tag:

print $closure;

And now it works! Thanks!

Pibu’s picture

Status: Active » Fixed
Anonymous’s picture

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

it should say in the readme that you need to use $footer in your template for this because on most websites I don't use this variable.

budda’s picture

It's a standard part of the Drupal API. Fix your themes.

GarethWatkins’s picture

Hi All

I had this problem on 5.1 - I found the problem was that when I extracted the tarball, the directory created in the module dir was google_analytics. I renamed it to googleanalytics and that fixed it.

Cheers

G

holydrupal’s picture

Priority: Normal » Critical

again not working!
my theme has the "closure" and my UA-# is correct but code doesn't appear!

any idea?

brianV’s picture

I am having the same issue:

print $footer and print closure are both in my theme; however, the Analytics code is not appearing for any roles (Admin, anon, auth).

holydrupal’s picture

Category: support » bug

adding Google Analytics module>

set the settings in Google Analytics page >

use reuquire codes in theme >

> NOTHING‌ added to your site!

Can someone help us?

salientknight’s picture

same problem three years later....

hass’s picture

Category: bug » support
Priority: Critical » Normal