Search Engine Optimization for Toronto and the World!

Google Analytics for Drupal

Analytics are the heart of SEO. As Peter Drucker, Robert Kaplan, and millions of others have said, "If you can't measure it, you can't manage it." For SEO, to say that is almost redundant. (Technically, it would be a tautology. I apologize, but I have 2 degrees in professional writing so these things matter to me.)

What I'm trying to say is that from a certain basic perspective, there is nothing more to SEO than managing the numbers you get from Google. Visits, bounces, average times, segmentation, and so forth - that's all that matters. As you might guess, I have different ideas, but this is not the blog post to get into it. Instead, a quick shakedown on how to get rolling with Google analytics with a Drupal site.

First, get you Google Analytics account up and running: www.google.com/analytics if you haven't done it already. It's free, which is a pretty good deal for such a fundamental business tool. You can manage multiple web sites from a single account, which is very handy indeed.

Next, you want to add a profile for your site. Be sure to use the full URL, including the www part. Sometimes you'll have subdomains where the URL won't start with www, and you'll want to track them separately.

After you've added the website to track, Google Analytics will give you some code to add to your web pages. If you were hand coding your web site, you'd have to add the code block to each page - a royal pain. Or you might have to add it to a template - also a pain. Fortunately, with Drupal all you really need is the Web Property ID, which is a number embedded in the code chunk. Google gives it to you at the top of the Tracking Code page part of the set-up process. It'll look something like this: UA-12345678-1. Write that down.

Now in Drupal, you want to install the Google Analytics module, which you can find at http://drupal.org/project/google_analytics. Enable the module and go to it - it's under Site Configuration. There at the top of the page, under General Settings, is the Google Analytics account number. Drop your Web Property ID there. Don't ask me why this number is called two different things in two different places - that's open source for you.

Click the "Save configuration" button at the bottom, and... you're done!

It might take a little while before Google analytics notices that you've got things installed on your site, but you have essentially set things up. Of course, there are many many things you can do after this, but this is the first and necessary step. Once again, Drupal has made a job remarkably easy. All you had to know was exactly what to do first.

Recent posts

Type Title Author Replies Last Postsort icon
Story The Further Adventures of a Director of Marketing-Errant Pete Kloppenburg 0 08/24/2010 - 22:15
Page A test page Pete Kloppenburg 0 07/22/2010 - 11:53
Page Pete Kloppenburg's magazine writing Pete Kloppenburg 0 12/23/2009 - 13:06
Page Pete Kloppenburg's Marketing and Writing Portfolio Pete Kloppenburg 0 12/23/2009 - 12:00
Blog entry Drupal site maps: your hotline to Google Pete Kloppenburg 0 12/20/2009 - 13:20
Blog entry First page Google ranking! Pete Kloppenburg 0 12/07/2009 - 06:25
Blog entry Nuts and bolts: Drupal meta data Pete Kloppenburg 0 12/05/2009 - 17:50
Blog entry In which Pete goes optimizing, and nearly catches a visitor Pete Kloppenburg 0 11/29/2009 - 03:11
Page Pete Kloppenburg Pete Kloppenburg 0 11/25/2009 - 12:34
Page Web Marketing, Content, Strategy, and Great Ideas Pete Kloppenburg 0 11/24/2009 - 11:46
Blog entry Google Analytics for Drupal Pete Kloppenburg 0 11/20/2009 - 00:22
Blog entry Live Twitter feed widget Pete Kloppenburg 0 11/18/2009 - 17:02
Blog entry Drupal Twitter module Pete Kloppenburg 0 11/18/2009 - 16:08
Blog entry The speed of Twitter Pete Kloppenburg 0 11/17/2009 - 15:04
Blog entry Kick-off blog post, and URLs for good SEO Pete Kloppenburg 0 11/16/2009 - 23:11