Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant