Analytics
3.5K members online now
3.5K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Universal Analytics Event Tracking Not Working in FireFox

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello,

 

I've implemented the Universal Analytics code into my site and I am tracking a Contact Form Submission Event by tracking when the "Submit" button is clicked.  It seems to work perfectly in IE and Chrome (verified through Real Time) but when the button is clicked in FireFox (43.0.4) nothing happens and no events are tracked.

 

My tracking code is located before the </head> tag at the top of the page:

 

    <script>        
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXXX-YY', 'mydomain.com'); ga('send', 'pageview');
</script>

 

And the event is being pushed with the "ga()" function:

 

 <button type="submit" name="action[contact]" value="Submit" onclick="ga('send', 'event', 'Form-Submit', 'Click', 'Contact-Form-Submitted');">Submit</button>

 

As I said, It works fine in Internet Explorer and Chrome but does not send the event to Google Analytics in FireFox (43.0.4).

 

Any suggestions?

 

Thanks,

 

D.

Re: Universal Analytics Event Tracking Not Working in FireFox

A T
Participant ✭ ✭ ✭
# 2
A T
Participant ✭ ✭ ✭
Hi,

Try Firefox in private mode. There might be some extension like adblock, blocking the GA calls / some JS error.

Best Regards,
GA Guru.

'Star' or 'Accept as Solution' if it helped.

Re: Universal Analytics Event Tracking Not Working in FireFox

[ Edited ]
Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi. I had the same issue for one of my site. It was related with blocked Google Analytics requests. I found the great article and want to share it with you:
http://veithen.github.io/2015/01/24/outbound-link-tracking.html

Re: Universal Analytics Event Tracking Not Working in FireFox

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭
Thanks for your feedback. I would prefer not having to customize settings on the browser, as I can't expect users change their settings. I do believe there is a problem with analytics.js loading on Firefox, thereby preventing it from actually executing the ga() function, but I'm not sure how to work around it.

Re: Universal Analytics Event Tracking Not Working in FireFox

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
In my case I have more than one GA initialization in the site (different widgets have own GA). I added the following rule:
if (window.GoogleAnalyticsObject) {
// Detected prev GA script
__myGa = window[window.GoogleAnalyticsObject];
} else {
// Default initalization of my __myGa
}

Re: Universal Analytics Event Tracking Not Working in FireFox

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭
Natasha,

The article you provided was very helpful, however this particular button is not really an outbound link. If I'm reading it right, the article is assuming that in clicking the link, the script doesn't load before the browser is directed to the next page. But in this case there is no page change. So why would there be a problem getting the function to load?