1
votes

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.

1
What error message - if any - are you getting in your web console? IF you are not seeing an error, is a HTTP request actually going out according to your Network tacker in your browser? - thatidiotguy
are you using single or multi-page model? - Omar
No errors being thrown. It does not look like it's sending an HTTP request. - alpheus
I'm using the multi-page model. - alpheus
What does the HTTP request look like in Firefox? Is it getting aborted? - Blexy

1 Answers

0
votes

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.