Drupal 7: Google Analytics and Google Webmaster Tools Setup

At first, I dismissed the need for yet another module.  I have always added the Google Analytics code straight into a template file in various other CMS and static sites I have been involved in over the years.  Why do I need a module to do that?  Well, you don't, but the Drupal Google Analytics Module does offer a lot more functionality that will make it worth your while.

The first thing you need to do, it you haven't is sign up for a Google Analytics account.  It's pretty straight forward process. 

Once you are signed up, the most confusing thing to me was the Account vs. Property vs. View:

Google Analytics Admin

I break it down like this.  Account is the company or the owner.  The Property is the website.  The view is segmented data of the website.  At first, you should have a default "All Website Data" view, but moving forward you may have an app and a website, or a view for different languages on the site like /en and /de.

Once signed up, install the Drupal module:

  • 
    drush dl -y google_analytics
    drush en -y google_analytics
    
  • Set Permissions at:
    
    /admin/people/permissions
    
  • Enter your tracking ID and set configurations at:
    
    /admin/config/system/googleanalytics
    

You can really save yourself a lot of time by configuring the built in features.  You can track Single, Multiple, or cross domains. Track or exclude certain users, roles and/or pages.  You can track file downloads, site search, and even Drupal messages.  See the module page for a full list.

Next, you should also sign up for a Google Webmaster account.  This tool offers you a chance to get direct feedback from Google about how they see your site.  Connecting your Webmaster Tools account to you Analytics accounts brings additional insight, and easier verification on the Webmaster Tools side.  When launching, or relaunching a new site, I always submit the XML Sitemap directly to Google through Webmaster Tools.  I find that you get a much faster indexing, and you can check back on any errors they may find.

This is really just the tip of the iceberg.  The advancements that seem to happen seemingly everyday in web analytics is amazing to me.  How it is going to evolve next from sites and pages to apps, and watches, and goggles, and content "chunks" is going to be something to see!