Skip to content

Instantly share code, notes, and snippets.

@googleanalyticsresoneo
Created May 27, 2011 16:41
Show Gist options
  • Save googleanalyticsresoneo/995643 to your computer and use it in GitHub Desktop.
Save googleanalyticsresoneo/995643 to your computer and use it in GitHub Desktop.
Ignorer des referrals sur la base d'une regexp
/* http://www.roirevolution.com/blog/2011/01/google_analytics_subdomain_tracking.php */
/* Ignorer les possibles affluents sur des domaines matchant une regex */
try{
if ( /vols\d{0,2}\.thomascook\.fr|www\.thomascook\.fr|booking\.thomascook\.fr|enwi\.norrisdata\.net|ypsilon\.net/.exec(document.referrer) ) { _gaq.push(['_addIgnoredRef', document.referrer.split('/')[2].split('.')[1]]); } } catch(e){}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment