Last updated March 25, 2011. Created by hass on May 31, 2008.
Edited by EvanDonovan. Log in to edit this page.
Google Analytics can take around 24-48 hours to display its first lot of statistics about your site, so do not be alarmed that you don't see anything for a while.
Theme compatibility (7.x)
If you're not seeing the JavaScript code appearing in the top/bottom of your sites HTML please ensure your theme includes the standard PHP code:
<?php print $page_bottom; ?>
at the bottom of your html.tpl.php. If your theme do not have this file a core html.tpl.php is used and this one have this variable.
Theme compatibility (5.x, 6.x)
If you're not seeing the JavaScript code appearing in the bottom of your sites HTML please ensure your theme includes the standard PHP code:
<?php print $closure; ?>
at the bottom of your page.tpl.php (see Garland's page.tpl.php for an example placement).
If stats not showing after a module upgrade
If the tracking code is not working properly after a version upgrade, you may need to clear all caches again, just as a precaution.
If you are using custom code, and you have just switched to the asynchronous JS (i.e., have upgraded to a 3.x version from a 2.x), you will need to manually rewrite the code that you were adding in the "after" section. See the 2.x->3.x upgrade guide for more details.
Debugging tracker responses using ga_debug.js
Google provides a Chrome extension for debugging Google Analytics called ga_debug.js. It is helpful in debugging, since it will show what is being sent to Google in Chrome's Javascript console.
Note that, according to #921308-14: Document that module using asynchronous javascript but not able to correctly load code in header, the ga_debug.js may report that the asynchronous snippet is not being used, even if local caching of ga.js is disabled in admin/settings/googleanalytics.
Validation in Google Webmaster Tools
According to #921308-20: Document that module using asynchronous javascript but not able to correctly load code in header, Google Webmaster Tools validation of website ownership may fail if you try the Google Analytics method. This is because hook_footer(), which this module uses to add the Analytics Javascript cannot be used to add the Analytics code to the header, where Google expects it to be.
This should not affect site ownership validation in Google Analytics itself, however.
Ubercart Compatibility
Note that the 3.x (asynchronous) branch of the Google Analytics module is only compatible with Ubercart 2.5 (once it is released), or the Ubercart 2.x-dev. If you do not wish to run a dev version of Ubercart, you can patch the Ubercart Google Analytics module with the patch from #922230-16: Asynchronous tracking for Google Analytics.
Staying on the 2.x branch of Google Analytics is not recommended since Google has deprecated various parts of the non-asynchronous tracking API.