Installing & Configuring the Google Analytics Module for Drupal 6.x

Posted Date: 
Thu, 03/26/2009

The Google Analytics module for Drupal 6.x integrates Drupal's powerful site administration tools so you can harness the fullest potential of your Google Analytics account.  The module offers user-specific, role-specific, and page-specific tracking.  It can send role or profile information to Google Analytics so you can run user segmentation reports.  You can easily extend your Google Analytics with custom JavaScript code.  The possibilities are endless!

What is Google Analytics? It is the next-generation web analytics tool that show you how people find your site, how people navigate through it, and how they become customers. Google Analytics is both easy to use and offers an enterprise-class reporting interface.  Google Analytics is also free!

Note: It's a high resolution video, so it plays well in full screen mode.

Primary Screencast: 
Syndications

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Awesome video. Walked me

Awesome video. Walked me through the steps that I needed and was very simply to follow. Thanks for the help.

excellent

wow this was great. thank you so much for your time.

Nice work.

Thanks for the screencast. Very helpful. And I love your disclaimer! LOL. Made my day.

Cheers Chris.

you're welcome Chris!

I'm glad you enjoyed the video.  Looking for more videos?  Check out my latest project: http://yadadrop.com/drupal-video

Nice

Hey, thanks for the google analytics tutorial. Really helpful. You talked about specific page tracking - pretty cool, but I exclude my domain via analytics itself - any advantage?

Btw, I'm migrating from a static site to drupal - the difference is really night and day. Not a whole lot different for the user I don't think, but admin-wise definitely worth it.

When you say that you

When you say that you excluded your domain via analytics itself, how did you configure that?  That must have been a feature outside of the drupal module.

The page-specific tracking is really helpful when you don't want to clutter up your total, unflitered google analytics report.  For instance, pages that are hit excessively by admin users or content creators would be perfect examples of how an inflated pageview would distort your overall, unfiltered, unsegmented report.

Since you're converting from a static site, you might benefit from my drupal videos project found here: http://yadadrop.com/drupal-video

analytics

Analytics itself has a setting where you can exclude hits from your domain. Pretty nice for a "static" site. Thx for the reference to the other video.

Btw, do you have a video that explains how to put an icon right next to the "http://www.yoursite"?

favicon

favicon settings are theme-specific.  many drupal themes let you assign a path to your favicon.ico file here:
domain.tld/admin/build/themes/settings/[theme_name]
OR, follow this path in the admin menu: Home › Administer › Site building › Themes

A buddy of mine put together this video which shows you how to configure several things related to themes (including the favicon).  His demo uses the Zen theme.
http://www.youtube.com/watch?v=AaCoTiZPh9s 

Peace,
Brian
 

Thx

Thanks man, didn't watch the video, but your instructions were right on.

thank you

for the effort!It was very helpful!!!

Very Helpful

Thanks - I am pretty new to Drupal and as many others have already said your video was very well done. Very helpful.

you're welcome

thank you! 

Awesome module and awesome

Awesome module and awesome video! :-)

Thanks!

Thanks a lot

Thanks a lot

thank you

 thank you!

Thanks!

I just wanted to say thank you, Brian! Nicely done module and nicely done video. Clear for virtually anyone, I'd think. Well done!

thank you david

I appreciate it.  thank you for leaving me a note. :-)

Great Video

A very helpful video. I was using a block of javascript for google analytics so far, but your video has convinced me to use the module.

But do tell me, what is the difference between extracting the module in the /module directory and the /sites/all/module directory, if there is only one site running on the installation?

great question shaunak

I was wondering the same thing sometime ago.  In a nutshell, it's a "best practice" to copy user contributed modules to /sites/all/modules directory.  When it comes time to upgrade Drupal, one needs to overwrite the Drupal installation directory with the new core files and then restore the sites directory to keep all of your custom settings. In other words, your life becomes simpler when you separate contributed modules from core modules. For reference, check out steps #1 and #8 of the UPGRADE.txt in the root of your Drupal install.

Peace,
Brian

I'm still pretty new to

I'm still pretty new to Drupal, so this might seem like a question with an obvious answer for regular Drupal users- but I'm trying to track only anonymous users on my site. Under the Page Specific options, I'm assuming I keep all the default pages listed so as not to throw off my stats, but I'm kind of wondering about the "node/*/*" page. If I leave that in there, does it mean that it only tracks anonymous users that visit the home page, and not my other "nodes"? Clarification on that would be much appreciated. :)

Thanks!
Rachel

about node/*/*

Hi Rachel,
Those default values that you see in there are to help filter out page views that might skew your analytics totals. In this case, node/*/* is to detect "node add" or "node edit" operations. The urls for those operations look like this:
http://www.brianstevenson.com/node/add/page
http://www.brianstevenson.com/node/1591/edit
The asterisks (*) are wildcards that detect any value.  So keywords like "node/add/page" or "node/1591/edit" would be excluded with a "node/*/*" rule.
Hope that helps.  :-)
Peace,
Brian

Excellent video. You speak

Excellent video. You speak very well and clearly. You should also focus on creating tutorials/how-to's via screen-casts for other topics revolving around Drupal. How about one for Clean URLs?

Sorry I should have finished watching your great Video

Never mind, I got ahead of myself as usual

Google Tracking Code

Fantastic job on the Video. What is missing for me sense I don't PHP code is to where to put the Google Tracking Code on my site so it shows up on every page? I would think in a Block however I only have HTML Input Formats available. What am I missing here? Running Drupal 6.13

Thanks

Very nice video

Hi Brian,

I like your video, it is easy to follow and gives just the right amount of information.

I tried configuring the module, but am getting an error message. It says: "A valid Google Analytics account number is case sensitive and formatted like UA-xxxxxx-x." I know the account number is correct since I am simply copying and pasting it directly from the Google Analytics site.

Any ideas why this is happening? What does your module do to verify a valid Google Analytics account number?

check for trailing spaces

Sometimes when I copy and paste from the web, I get trailing spaces at the end of the text I want.  Copy and paste again and see if there isn't a little white space at the end that can be deleted out.

Success!

That worked. I guess sometimes those white spaces are hard to see.

Thanks

Excellent video

Well done - entertaining, reassuring yet concise.

you're welcome!

you're welcome!

Thanks a lot!

Hey Brian,

I just wanted to thank your excellent screencasts.
They are precise, informative and yet funny.

You rock the house.

:-) thank you!

:-) thank you!

Very Helpful, thanks!

Very Helpful, thanks!

Hi, top screencast. What is

Hi, top screencast.

What is that yellow glow around your mousepointer? A special tool ?

Thanks for your answer.

thanks alex

Thank you for the compliments!  The yellow/gold circle around my cursor is a feature of CamStudio.

about panel

SIR i saw your screen cast video for google analytical settings.
it was nice explanation.

Similliar to that can you send a screen cast for creating a new panel in drupal 6.x

I tried to do it with example of learn by the drop .com

but its version was 5.x there is lot of difference between 5 and 6.

So please help me to learn how to work with pannel and what are the modules required for running panel

great video!!!

great video!!!

Google analytics?

lol - alergic to awesome..

I have a question for you if you dont mind answering.
I have installed google_analytics-6.x-2.2 in drupal 6.10.
When i am uploading the google_analytics-6.x-2.2.tar.gz modual in the upload modual i get the following error -

The selected file google_analytics-6.x-2.2.tar.gz could not be uploaded. Incorrect module package for module=google_analytics.

When i go to the moduals page it seems that the google analytics modual has been installed.

So i enter all the details as you show in your video.

Then i log into my google analytics account and when i do i see that the staus for my site has a clock under it instead of the tick mark that you have.

Do you know what the issue is here?

I recon its probably the modual install or does it take a while for the process to complete?

Cheers man

re: installation

If your web site is http://www.footballphotoshop.com/ then it appears that your google analytics code is rendering in your html.  so I think you are correct in your observation.  Google analytics takes anywhere between 24 to 48 hours to start receiving data.  Try back later today or even tomorrow and you should see your data.

Hey brian.. Everthing worked

Hey brian.. Everthing worked out.. Thanks alot for the help.

great!

glad to hear the videos were helpful!

Thanks

Hey Brian,

Thanks for the walk through on setting up google analytics in drupal. It was a big help to a first time installer like me.

Thanks,
Kunal

You're welcome!

Thank you for letting me know this video was helpful.  :-)

Thanks, that was a great

Thanks, that was a great walk-through. Appreciate it.

I am just starting out with

I am just starting out with Drupal. Thanks for the Google Analytics tutorial. It will save me a lot of time.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Subscribe to Drupal Screencasts (RSS)