Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

outboundFormTracker clashes with default form submission halting behaviour on IE11 and iOS < v11.3 #230

Open
bestdamnfriend opened this issue Jul 4, 2018 · 0 comments

Comments

@bestdamnfriend
Copy link

bestdamnfriend commented Jul 4, 2018

We are using the analytics.js method on our websites, with outboundFormTracker, and are unable to halt a form's submit() event to do some more processing if we are also using the Outbound Form Tracker. This issue only seems to come to light on IE 11, and earlier versions of iOS (pre 11.3). Unfortunately, a lot of our users need these browsers.

Google code:

<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-XXXXXXX-XX', 'auto');
ga('require', 'outboundFormTracker');
ga('require', 'outboundLinkTracker');
ga('send', 'pageview');
</script>
<script async src="https://www.example.com/google/js/analytics.js"></script>
<script async src="https://www.example.com/google/js/autotrack.js"></script>

Form code:

$('form').on('submit', function(e) {
    e.preventDefault();
});

This code works perfectly on most browsers, but is ignored on the aforementioned. return false is also ignored. The only way we can get it to work is to comment out the outboundFormTracker require.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant