For some reason the below code will fire fine in Chrome, but not in Safari or Firefox. The Google Analytics code is loaded in the footer of the site. This site is running on jQuery mobile. I am not sure if it's a real time reporting thing in Analytics where it will only work for Chrome, or just not working all together.

I also did a console.log inside the if statement and it fired fine in Safari, so I know it's getting to that point.

// Event Tracking For Bottom Tabbed Menu
$(document).on('click','.single-footer-menu a',function(){
    var label = $(this).text();
    if( typeof label !== 'undefined' ) {
        ga('send', 'event', 'Bottom Tabs', 'Tap', label);
    }
});

To further clarify we are on Google Analytics Universal. I used https://developers.google.com/analytics/devguides/collection/analyticsjs/events as a reference.

As another update. I have replaced the tracking code and events with Google Analytics classic, and it works fine in Firefox/Safari. It appears to be isolated to a Google Analytics Universal issue.

Issue Resolved: I used the Google Analytics Universal embed code to load GA, but used the classic push events for page views and event tracking: _gaq.push(['_trackPageview']);

Apparently you can still use _gaq with Universal Analytics. After I did this, I no longer had sporadic behavior and it worked in all browsers and all devices 100% of the time.

有帮助吗?

解决方案

Issue Resolved: I used the Google Analytics Universal embed code to load GA, but used the classic push events for page views and event tracking: _gaq.push(['_trackPageview']);

Apparently you can still use _gaq with Universal Analytics. After I did this, I no longer had sporadic behavior and it worked in all browsers and all devices 100% of the time.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top