Hello,

I recently installed the Google Analytics module to a Drupal 4.7 to test it, but decided to remove it, and I am having a strange problem: even after disabling this module and deleting all its the files from the server, the GA script code is still showing in my HTML code.

I flushed the cache of both Drupal and my browser, to no avail. I made sure that the script code was not somehow inserted in the page-tpl.php template, and it was not there. So, I am at a loss at to where look for.

Has anybody had this problem? Is this a known issue?

Any hints would be greatly appreciated.

Comments

BradM’s picture

did it leave anything in the database tables? when viewing modules, there is an 'uninstall' link -- is it still listed there?

Kokito’s picture

I don't know if anything was left in the DB, but I will check.

The /admin/modules page does not show an uninstall link.

BradM’s picture

/admin/build/modules should have a LIST tab and an UNINSTALL tab at the top of the page.

Kokito’s picture

I think that would be in Drupal 5. This is a 4.7 installation. :)

Kokito’s picture

I just discovered one more thing (by accident).

If I log off, the GA script code does show in the HTML code.

/me is puzzled...

Kokito’s picture

After spending about two hours looking everywhere, it turned out that the GA script had been hardcoded (most by one of our admins) to index.php in the root directory. Removing the code from this files solved the problem.

Sorry for the noise... :(

pkahn’s picture

This is the exact same problem I'm having with my site. However, I checked my index.php and the code was NOT found there.

I have several 4.7 Drupal sites and I've tested this problem on all of them and it's consistent for me.

Install module, turn on, enter UA-XXXXX-X number, use for a while, disable code, remove module - and the html code still persists with the entered UA-#.

How can I get rid of this code. It's gotten worse as one of my partners put in the wrong UA-# and now I can't get rid of it.

For instance this is what it now looks like on one of my sites while the module is activated (Note two UA #'s, at least they are the same)

_uacct = "UA-xxxxxxx-1";__utmSetVar('');urchinTracker(); _uacct = "UA-xxxxxxx-1"; urchinTracker();

This is what it now looks like on another site with the module activated (Note the two UA #'s are different GRRRRR!)

_uacct = "UA-xxxxxxx-6";urchinTracker(); _uacct = "UA-xxxxxxx-1"; urchinTracker();

And, this is what it looks like on a third site where I have DEACTIVATED the module. (and this number is NOT the number that I had put in when I activated the module and configured it the last time, this is the WRONG number that my partner accidentally entered and now we cannot get rid of it. If I reactivate the module I get the "double" script in the previous example above.)

_uacct = "UA-xxxxxxxx-1"; urchinTracker();

Any ideas out there?

Drupal 4.7

pkahn’s picture

Is this a drupal bug?

ceejayoz’s picture

Probably not - http://drupal.org/node/217254#comment-715280

Check that it isn't just hard-coded into your theme files.

pkahn’s picture

anyone else out there had this happen?

pkahn’s picture

somehow the code persists in the page.tpl.php file in the THEME directory. deleted it from there and the "script" is no longer doubled up with the wrong number showing.
still haven't figured out where the module writes the code b/c the correct "script" with the correct number is still showing up in all my page sources. and why it would write this code upon deactivation.

anyway, just in case anyone else runs into this, here's a workaround.