Created
January 9, 2020 04:31
-
-
Save goosmurf/9fec28db0e9747baa70a0120af59e389 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<!-- Google Analytics --> | |
<script> | |
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; | |
ga('create', 'UA-457690-7', 'auto'); | |
//ga('set', 'transport', 'beacon'); | |
ga('send', 'pageview'); | |
// This is correct | |
ga('send', 'event', { | |
eventCategory: 'Test', | |
eventAction: 'action', | |
eventLabel: 'Working beacon', | |
transport: 'beacon' | |
}); | |
// This doesn't work; if you check your Network tab you'll see it falls | |
// back to using an image | |
ga('send', 'event', | |
{ | |
eventCategory: 'Test', | |
eventAction: 'action', | |
eventLabel: 'Broken beacon', | |
}, | |
{ transport: 'beacon' } | |
); | |
</script> | |
<script async src='https://www.google-analytics.com/analytics.js'></script> | |
<!-- End Google Analytics --> | |
</head> | |
<body> | |
Derp | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment