Skip to content

Instantly share code, notes, and snippets.

@leighmcculloch
Last active September 15, 2020 12:52
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save leighmcculloch/7596803 to your computer and use it in GitHub Desktop.
Save leighmcculloch/7596803 to your computer and use it in GitHub Desktop.
This JavaScript will catch any outbound links and register them with Google Analytics before the browser loads the linked URL. This script works with Google's new analytics.js and not the older ga.js. This script ensures the attempt to register the page with Google Analytics is complete before continuing to load the next page. This capability is…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment