try/catch around ga() calls

This commit is contained in:
Jarrad Hope 2017-01-10 20:49:57 +07:00
parent b384c15731
commit a4538326bc
2 changed files with 7 additions and 3 deletions

View File

@ -349,8 +349,10 @@
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-79146816-1', 'auto');
ga('send', 'pageview');
try {
ga('create', 'UA-79146816-1', 'auto');
ga('send', 'pageview');
} catch(e) {}
</script>
<!-- /Google Analytics -->

View File

@ -239,7 +239,9 @@
//Disable form inputs
disableInputs();
//Send GA event
ga('send', 'event', 'Waitlist', 'Sign Up', 'Waitlist');
try {
ga('send', 'event', 'Waitlist', 'Sign Up', 'Waitlist');
catch(e) {}
// If the form has errors, display them, inline if possible, or appended to #mce-error-response
} else {