Next Tutorial
Drupal 7 Tutorial Part 19: Understanding Drupal 7 Content Types & Fields Concepts !
How to add google analytics javascript code to Drupal Site ?
Install and Use google analytics module http://drupal.org/project/google_analytics provided by drupal.org community to easily install Google Analytics Javascript Code to your drupal site.
After installing this module you have full flexibilty to enable or disable the Google Analytics JS code in specific pages of your drupal site.
Stay tuned for more drupal tips :-)
©2010 AnilSagar. All rights reserved. Drupal theme by Kiwi Themes.

5 comments
got this popup on your site
warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Denver' for 'MDT/-6.0/DST' instead in /home/anilsag5/public_html/modules/comment/comment.module on line 1514.
Trouble installing code into google analytic module.
I installed google analytic and inserted my google ID. Google not recognizing that it's there. I also tried inserting it under advanced settings and it's still not working.
Isn't it really silly and
Isn't it really silly and lame that we need a module to add simple Google analytics javascript code? This only goes to show the weakness of Drupal.
It Depends
Dear User,
It depends on requirement. In Drupal features are available as modules. Modules are optimized and tested by the community.
Google Analytics modules provides below functionality apart from just tracking code to the site.
Single/multi/cross domain tracking
Selectively track/exclude certain users, roles and pages
Monitor what type of links are tracked (downloads, outgoing and mailto)
Monitor what files are downloaded from your pages
Custom variables support with tokens
Custom code snippets
Site Search support
AdSense support
Tracking of Goals
Anonymize visitors IP address
Cache the Google Analytics code on your local server for improved page loading times
Access denied (403) and Page not found (404) tracking
DoNotTrack support (non-cached content only)
Drupal is not weak. Drupal is so powerful and flexible. You can add google analytics code with out a module also. Just insert the script code in page.tpl.php
Hope you will change your view on Drupal.
Cheers,
Anil Sagar
sam
nice post you shared.
Post new comment