Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dawesi/3b4a7961bfecc4535dae86b880be5e2c to your computer and use it in GitHub Desktop.
Save dawesi/3b4a7961bfecc4535dae86b880be5e2c 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