Streaming live at 10am (PST)

Tracking opening of tabs in Analytics


#1

Hi

I have added tab link ID’s to the tabs and this opens the tabs if you add the tab #ID in the end of the URL, but the ID is not showing in the URL when pressing different tabs, so there is no way for Google Analytics to track what tab the users is opening… is this correct?

If so, is there a diffent way to track the tabs in Analytics?


#2

Which version of analytics are you using?

ga.js or analytics.js?


#3

Hi @webdev

Have to check with the client, I have not connected the site to Analytics yet, but I’m guessing Analytics.js since that is the newest version.


#4

Just add a some custom code to to your page to capture the event.

$('#tab1').on('click', function(e) { //_gaq.push(['_trackEvent', 'something', 'Open', 'something']); console.log("Tab1 Clicked"); });
With Analytics.js the function would trigger the Event Tracking using this format;
ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue], [fieldsObject]);