A Kingdom-minded follower of Jesus, embracing the prophetic-apostolic, with a missional-postmodern expression. huh?

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.

Perfect!

Thanks, it worked all well!

user config

Hi!

First of all thank you the great video! It's awesome!

Bit i have a question! I've tried to setting google analytics in my page and it went well except one thing. I can't see the tracking option in the edit user menu. It would be important for me because there are three user who i don't want to track!

Thank you the help!

try looking here

Thanks dumi!  See if this works for you:

/admin/settings/googleanalytics
 under > "User specific tracking settings"
   select > "Track users by default, but let individual users to opt out."

 under > "Role specific tracking settings"
   Make sure that none are checked (everyone tracked) or you check the roles that matter to you.

/user/###/edit
  under > "Google Analytics configuration"
    check > "Enable user tracking"
 

Thank you the help! I think i

Thank you the help!

I think i misunderstood the meaning of the "Track users by default, but let individual users to opt out." Thanks for my not excellent english!

Thank you again!

What am I missing?

Ok, I would like to first make it clear that I am not allergic to awesomeness but I apparently am missing something here.

I performed the walkthrough just as the video explained it. Google Analytics however tells me that tracking code is not installed on my pages. Did I miss this part in the setup? My reading indicates that this module is supposed to take care of this after I entered the GA number.

Thanks for great video

Thanks for great video

it might be a cache issue

Go into this page:
YOURSITE.com/admin/settings/performance

There is a button near the bottom that reads, "Clear cached data".  Click it.
Have Google scan your site again and let me know the results.
Peace,
Brian

Problem with Tracking not installed

I am new to Drupal and Analytics but have been tasked with sorting it out. I followed your excellent video and installed the google_analytics module. I left it wide open to grab all data. No segmentation or permissions monkey business for now. I just want a baseline. So following install, I checked back with Analytics and it was reporting that the tracker was not installed. I flushed cache under performance and still no change in status. Any ideas would be appreciated. Thanks in advance, Brian. Keep up the good work.

Danny

I think I know what's going on

Danny,
I did a quick survey of your site (http://www.tmjassociation.org/) and I think I know what going on.  The Google Analytics appears to be partially working.  First, I can see google analytics showing up in your jquery (around line 41 in your rendered html when doing view source).  The issue appears to be with your Drupal template.  If you could, check out your page.tpl.php file.  Near the very end of your php source code, there should be this ending:
    <?php print $closure; ?>
  </body>
</html>
That "print $closure" is where the Google Analytics module puts the javascript.  If it's missing from your template, just put it in there, and clear your Drupal cache.  It should work just fine after that!
 
Peace,
Brian
 

This is the correct fix for my issue

Thanks man. I have created my own template and i for got to mention the closure statement..

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!

Comment viewing options

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

Subscribe to Drupal Screencasts (RSS)