Streaming live at 10am (PST)

Tracking opening of tabs in Analytics


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?

Which version of analytics are you using?

ga.js or analytics.js?

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.

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]);