Skip to content

Instantly share code, notes, and snippets.

View googleanalyticsresoneo's full-sized avatar

RESONEO Google Analytics googleanalyticsresoneo

View GitHub Profile
@googleanalyticsresoneo
googleanalyticsresoneo / GA remonter les erreurs 404.js
Created May 20, 2010 14:32
Remonte la page cible et le referrer sur une page d'erreur 404
/*
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]);
@googleanalyticsresoneo
googleanalyticsresoneo / moteurs de recherche france.js
Created May 20, 2010 16:55
Détection des moteurs de recherche utilisés en France avec Google Analytics
/*
Ajouter des moteurs de recherche francophone à Google Analytics
Syntaxe asynchrone
moteurs par défaut dans la 5.2.6
daum:q,eniro:search_word,naver:query,pchome:q,images.google:q,google:q,yahoo:p,yahoo:q,msn:q,bing:q,aol:query,aol:q,lycos:q,lycos:query,ask:q,netscape:query,cnn:query,about:terms,mamma:q,voila:rdata,virgilio:qs,live:q,baidu:wd,alice:qs,yandex:text,najdi:q,seznam:q,rakuten:qt,biglobe:q,goo.ne:MT,wp:szukaj,onet:qt,yam:k,kvasir:q,ozu:q,terra:query,rambler:query,conduit:q,babylon:q,search-results:q,avg:q,comcast:q,incredimail:q,startsiden:q
*/
_gaq.push(['_addOrganic', 'cuil','q',true],
['_addOrganic', 'cluuz','q',true],
@googleanalyticsresoneo
googleanalyticsresoneo / Filtre mots clef tapés.sh
Created May 28, 2010 13:39
Filtre mots clefs tapés quel que soit le réseau de diffusion
Extraction de referral : (\?|&)(q|p|x_query|kw|qs|as_q|recherche|rdata|query|what)=([^&]*)
Medium : cpc|ppc|sem
Output : user defined : $A3
A requis
B non requis
Override : yes
Case sensitive : no
Chaine pour le segment avancé (euh, ça sert à quoi ?)
(seek|recherche|result|search)|(\?|&)(q|p|x_query|kw|qs|as_q|recherche|rdata|query|what)=([^&]*)
Page and Visits in a custom report => page means "landing page"
From: Jeremy A <ja...@roirevolution.com>
Date: Fri, 6 Nov 2009 04:54:24 -0800 (PST)
Local: Fri, Nov 6 2009 2:54 pm
Subject: Re: Weird data in content reports
When you using Page and Visits in a custom report, it reports the
number of visits where that page was a landing page, not the number of
visits that included that page.
@googleanalyticsresoneo
googleanalyticsresoneo / onlick.js
Created October 22, 2010 10:42
Gestion des onlick / tradi & dans la même fenêtre
try{pageTracker._trackPageview('/goal/go/reservation');}catch(err){};setTimeout('document.location = \"' + this.href + '\"', 150);return false;
@googleanalyticsresoneo
googleanalyticsresoneo / google_image.html
Created May 2, 2011 15:04
Détection des mots clef pour le trafic en provenance de Google Image
<!-- exemple de referral depuis le 22 juillet 2011
http://www.google.fr/imgres?q=resoneo&um=1&hl=fr&sa=N&biw=1260&bih=832&tbm=isch&tbnid=oHqMFLKPHlmBuM:&imgrefurl=http://www.boitedeveille.fr/tag/resoneo/&docid=Hy5kqj7oMth2tM&w=191&h=82&ei=9kU4TtyKGcOs8gOq--z7Ag&zoom=1&iact=hc&vpx=602&vpy=176&dur=8629&hovh=65&hovw=152&tx=64&ty=32&page=1&tbnh=65&tbnw=152&start=0&ndsp=23&ved=1t:429,r:2,s:0
-->
<script type="text/javascript">
// now as a standard syntax
_gaq.push(['_addOrganic', 'google', 'q', true, 'google images', '/imgres?']);
</script>
@googleanalyticsresoneo
googleanalyticsresoneo / ga-async-seo-france.html
Last active September 25, 2015 18:18
Marquage GA asynchrone complet pour projet SEO marché français
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<!-- a la fin du head -->
<script type="text/javascript">
/*! marquage GA asynchrone de base pour projets SEO en France (c) analytics (chez) resoneo (point) com - 2013
fork it on https://gist.github.com/googleanalyticsresoneo/964266
*/
/* moteurs déjà présents dans ga.js 5.3.8
@googleanalyticsresoneo
googleanalyticsresoneo / ignoreregexp.js
Created May 27, 2011 16:41
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){}
@googleanalyticsresoneo
googleanalyticsresoneo / log.conf
Created June 7, 2011 13:51
Apache logging conf
#Format spécifique : vhost,time,request protocol,final response code,request URI,response size,user-agent
LogFormat "\"%v\",\"%t\",\"%H\",\"%>s\",\"%r\",\"%b\",\"%{User-Agent}i\"" vhosts-bots
# Conditionne le log en fonction du user-agent
SetEnvIf User-agent Googlebot isabot
SetEnvIf User-agent Slurp isabot
SetEnvIf User-agent msnbot isabot
CustomLog "logs/site_access_isabot.txt" vhosts-bots env=isabot
@googleanalyticsresoneo
googleanalyticsresoneo / track_exception_through_events.js
Created August 3, 2011 14:52
JS Exceptions tracked in GA Events
function trackErrorThroughEvent(exception, fct) { /* remontée des erreurs éventuelles pour détection des pbs */
_gaq.push(['_trackEvent', 'Erreur JS ' + (fct || 'native'), exception + ' name: ' + (exception.name || 'Error') + ' #mess: ' + (exception.message || 'n/a') + ' #nav: ' + navigator.userAgent , ' #url: ' + document.location.href + '#ref: ' + document.referrer ,,true ]);
}