How do I add Google Analytics to my Drupal Website?

Google Analytics is a free service from Google which can monitor the performance of your website. This system provides detailed information including how many visitors your website is getting, how long do visitors stay on your website, are new or returning visitors. Google Analytics also monitors other aspects of your website including links in and out of your site, the visitor's country and which language visitors speak, Goals and much more. Armed with this kind of information you can really start to target your website to the market place you are aiming for.

Using the Google Analytics module in Drupal is very quick and easy to set up and in no time at all, you will be able to see how well your website is doing using Google Analytics.

To install and activate this module, you will need to have the following already installed or set up:

  • Software to un-zip the module file
  • FTP Software already configured to see your server files
  • A Free Account with Google
  • A Drupal CMS website already loaded on your Server
  • Extra File Folders within your Drupal Installation

How to Set up the Drupal Google Analytics Module

  1. Download the Google Analytics Module from Drupal to your local computer by Clicking here This will open a new window in your browser
  2. The file you have downloaded will need to be un-packed before you can load to Drupal. This is done on your local computer.
  3. Using your FTP Software, Connect to your website folders (See our "FTP Knowledge Base" for further information)
  4. If you have not already done so, please read our FAQ on how to add modules to Drupal by Clicking here. Using your FTP programme navigate your way to the folder called: sites/default/modules. This should be located under your "public_html" folder.
  5. Now using your web browser, visit your Drupal website and login.
  6. In your Menu, Click on Administer and then Modules under the "Site Building" heading.
  7. Scroll down the page until you see the Google Analytics module and select the box beside it. Scroll down the page and click "SAVE"
  8. Click on Administer at the top of the page in the breadcrumb or on your navigation menu
  9. Scroll down under "Site configuration" and click on Google Analytics heading

For the next part, you will need to in a new tab or window in your browser, open Google analytics

  1. Log into your Google Analytics account by using your Google username and password. If this is the first time you have done this, you will be asked to confirm a few details
  2. Once you have successfully logged in, head for the section or link called "Add Website ProfileĀ»" Click on this link
  3. In the first option, we would suggest you keep this to "Add a Profile for a new domain"
  4. Type in the name of your website (in most cases you want to add the www.) making sure you choose the right prefix. This in most cases will stay as "http".
  5. Click on Finish to save and a new page will open up.
  6. If the details you have supplied are OK, you will see some code given to you. You do not need to install the code as directed by the website Make a note of the "UA-" number that is given within the displayed code.
  7. Go back to your Drupal website and the configuration page for the Google Analytics module and insert the "UA-" number as requested.
  8. Scroll down the page and choose which options you want to change. (We would recommend you leave them as their defaults for now unless you know what you are doing!)
  9. Click "SAVE" at the bottom of the screen and your Google Analytics Module is now integrated within your site

Leave this for about ten minutes and then go back to your Google account and at the top or bottom of the screen, you will see a "Test" button. If there is no problems, you will see a "Waiting for Data" come up in the Status. It can sometimes take a little longer so dont panic straight away if Google cannot find it first time.