Would like to add Google Pagetracker link to each quicktab so I can follow how often each quicktab is clicked on in Google Analytics. I see it might be possible looking at the source code but I'm wondering if there could be some integration with the Google Analytics module.

Comments

jhack31’s picture

Category: feature » support

I support this request. This would be awesome as 99% of the content of my site is now tabbed.

meramo’s picture

So guys no workaround since 2009? Would love to know how to track clicks on tabs, probably with ga events or something like this

kevinorin’s picture

Priority: Normal » Major

Would still like to be able to add tracking to Quick tabs. Just posting here to keep this thread going/active.

ultimateboy’s picture

Title: Adding Google Pagetracker to each quicktab link » Add Google Analytics Event Tracking to Quick Tabs
Version: 6.x-2.x-dev » 7.x-3.x-dev
Category: support » feature
Priority: Major » Normal

I was playing around with this the other day and it's actually quite easy. I wonder if there are standards for how ga_events should be fired from within Drupal modules, I can't think of any that do this currently.

Registering a google analytics event is pretty straight forward: (this is pulled from google's documentation)

Call the _trackEvent() method in the source code of a page object, widget, or video.
The specification for the _trackEvent() method is:

_trackEvent(category, action, opt_label, opt_value, opt_noninteraction)

category (required)
The name you supply for the group of objects you want to track.

action (required)
A string that is uniquely paired with each category, and commonly used to define the type of user interaction for the web object.

label (optional)
An optional string to provide additional dimensions to the event data.

value (optional)
An integer that you can use to provide numerical data about the user event.

non-interaction (optional)
A boolean that when set to true, indicates that the event hit will not be used in bounce-rate calculation.

I propose something along the following lines:

_trackEvent('Quick Tabs', 'Click', 'http://example.com/node#quickset-qt1_0')

I think the first and second parameters make sense, the third is tricky. GA doesn't really associate Events with specific pages (at least from what I can tell), and that's really useful information to know. Therefore, I think the third parameter should be the full url to the tab so that we know the tab the user clicked on and the page they did it on.

I'll clean up my code and post a patch soon, but I thought I'd at least get the discussion going again.

spandrelmatic’s picture

It's very good news that someone is interested in working on this. It would certainly be great to be able to track which Quicktabs users are clicking via Google Analytics, especially since that information could be compared to other user data (e.g. geographic location) to evaluate usage patterns. Does anyone know what the timeline might be on this? And are there workarounds that could be implemented now?

ultimateboy’s picture

spandrelmatic, the timeline is dependent upon this issue deciding on a standard for the _trackEvent() call. If you like my proposed solution, please say so...

Truthfully, the code to make this work is dead simple. Once we decide on a standard, I'll add it to the module.

spandrelmatic’s picture

Thanks for your reply, uboy. Your proposed solution with respect to the _trackEvent() call definitely makes a lot of sense to me, and it's exactly the sort of solution that would solve my immediate problem ... so you can count this as a vote in favor. :)

I suppose the forward-looking and community-minded question to ask at this point is what other use cases this approach would or would not serve well, but so far I haven't thought of any downsides (though it's true that GA can be something of a moving target). But from my point of view, I would say go for it whenever you have the time to do so.

Once again, thanks very much for your work on this.

joe_pixelrow’s picture

Issue summary: View changes

+1 for tracking on quicktabs.

Ideally a solution that will work with Universal Analytics as it seems everyone will have to switch over soon.

KevinOrin-1’s picture

Was this module ever updated for Google tracking?

spandrelmatic, the timeline is dependent upon this issue deciding on a standard for the _trackEvent() call. If you like my proposed solution, please say so...

Truthfully, the code to make this work is dead simple. Once we decide on a standard, I'll add it to the module.

james.bcn’s picture

Any progress on this? I have had a request from a site administrator for this functionality. It would be really useful. Can we get it added?