Amazon products on Content Management Systems and PHP-MySQL

Friday, May 1, 2009

Google Analytics in Joomla and Drupal

Here's an article I posted for http://www.joomlaexperiences.blogspot.com/ relevant also for installing Google Analytics script or code in Drupal. Tried the different Joomla google analytics modules but instead of trying to figure out how each works or is configured, I opted to try the manual, classic way of installing Google Analytics script in Joomla (or Drupal, and other opensource CMS) which is more foolproof. In one Joomla 1.0 project, I did the ff:

1. Registered the site in my Google Analytics account (your personal account can host multiple sites each with its own unique google analytics script generated and provided after successful signup).
2. When code/script was generated, determined which template the site uses.
3. In the template's index page (.../site/templates/templatename/index.php), I inserted the generated Google Analytics code/script provided for this site account just before the body closing tag.
4. After inserting the script in Joomla's template index page, go back to Google Analytics > Analytics Settings > Profile Settings for the site concerned > then click check status (somewhere in the upper right corner of the page).
5. Notice will be displayed if ga script was installed successfully, hence a "receiving data" status is given. One should just wait for the statistics to be generated then. 24 hour period should be sufficient waiting time.

Enjoy! Hope this helps!

P.S. the same should work with Drupal and other dynamic CMS templates irregardless of versions (just always make a backup copy of the template's index page for easy restoration if something didn't quite work).

Drupal Products