Created
May 20, 2010 14:32
-
-
Save googleanalyticsresoneo/407624 to your computer and use it in GitHub Desktop.
Remonte la page cible et le referrer sur une page d'erreur 404
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
/* | |
snipet pour extraire la page courante et le referrer et remonter l'information dans Google Analytics de façon exploitable | |
à utiliser dans la page d'erreur 404 | |
Auteur : analytics@resoneo.com | |
*/ | |
/* syntaxe asynchrone */ | |
_gaq.push(['_trackPageview','/erreurs/404/#page-en-erreur ' + window.location.host + window.location.pathname + window.location.search + '#accedee-depuis ' + document.referrer]); | |
/* mesurer les détails dans un évènement pour ne pas polluer les reports pages */ | |
_gaq.push(["_trackEvent", "Erreur 404", 'URL en erreur: '+ location.hostname + location.pathname + location.search, 'origine: '+document.referrer, 0, true]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment