Skip to content

Instantly share code, notes, and snippets.

@bookwyrm
Created March 8, 2012 17:57
Show Gist options
  • Save bookwyrm/2002356 to your computer and use it in GitHub Desktop.
Save bookwyrm/2002356 to your computer and use it in GitHub Desktop.
GA 404 tracking
if (is_404) {
_gaq.push(['_trackPageview', "/404.html?page=" \
+ document.location.pathname \
+ document.location.search \
+ "&from=" + document.referrer
]);
} else {
_gaq.push(['_trackPageview']);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment