173 lines
12 KiB
HTML
173 lines
12 KiB
HTML
<?xml version="1.0" encoding="UTF-8" ?>
|
||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||
<title>YBlog - Se cacher de ses statistiques web</title>
|
||
<meta name="keywords" content="analytics, statistiques, cacher, blog, jQuery, javascript">
|
||
|
||
<link rel="shortcut icon" type="image/x-icon" href="../../../../Scratch/img/favicon.ico" />
|
||
<link rel="stylesheet" type="text/css" href="../../../../Scratch/css/scientific.css" />
|
||
<link rel="stylesheet" type="text/css" href="../../../../Scratch/css/solarized.css" />
|
||
<!-- Font -->
|
||
<link href="http://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css">
|
||
<link href="http://fonts.googleapis.com/css?family=Droid+Sans:400,700" rel="stylesheet" type="text/css">
|
||
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://feeds.feedburner.com/yannespositocomfr" />
|
||
<!--[if lt IE 9]>
|
||
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
|
||
<![endif]-->
|
||
</head>
|
||
<body lang="fr">
|
||
<script type="text/javascript">//
|
||
document.write('<div id="blackpage"><div>Bientôt<img src="/Scratch/img/loading.gif" alt="Chargement en cours"></img></div></div>');
|
||
//
|
||
</script>
|
||
<div id="content">
|
||
<div id="header">
|
||
<div id="choix">
|
||
<div id="choixlang">
|
||
<a href="../../../../Scratch/en/blog/2010-06-17-hide-yourself-to-analytics" onclick="setLanguage('en')">
|
||
English </a>
|
||
</div>
|
||
<script type="text/javascript">//
|
||
document.write('<div id="switchcss"><a href="#">Changer de theme</a></div>');
|
||
//
|
||
</script>
|
||
<div class="flush"></div>
|
||
</div>
|
||
<div id="navigation">
|
||
<a href="../../../../">Home</a>
|
||
<span class="sep">¦</span>
|
||
<a href="../../../../Scratch/fr/blog">Blog</a>
|
||
<span class="sep">¦</span>
|
||
<a href="../../../../Scratch/fr/softwares">Softwares</a>
|
||
<span class="sep">¦</span>
|
||
<a href="../../../../Scratch/fr/about">About</a>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="titre">
|
||
<h1>Se cacher de ses statistiques web</h1>
|
||
</div>
|
||
<div class="flush"></div>
|
||
<div id="afterheader">
|
||
<div class="corps">
|
||
<p>Voici un moyen très simple de ne plus être comptabilisé dans les visites de son propre site. Tout d’abord, vous devriez jeter un coup d’œil sur comment <a href="../../../../Scratch/fr/blog/2010-06-17-track-events-with-google-analytics">je gère les systèmes de récupération de statistiques</a>. Je centralise tout dans un seul fichier javascript ce qui facilite le travail.</p>
|
||
<p>Cette méthode nécessite l’utilisation de <code>jquery-cookie</code>.</p>
|
||
<p>Avant de comptabiliser les visites, je vérifie que la clé <code>admin</code> n’est pas utilisée dans mes cookies.</p>
|
||
<pre class="sourceCode javascript"><code class="sourceCode javascript"> <span class="kw">var</span> admin = $.<span class="fu">cookie</span>(<span class="ch">'admin'</span>);
|
||
<span class="kw">if</span> (! admin) {
|
||
<span class="co">// put your analytics code here</span>
|
||
} <span class="kw">else</span> {
|
||
<span class="kw">console</span>.<span class="fu">log</span>(<span class="st">"[WARNING] you're HIDDEN to analytics"</span>);
|
||
}</code></pre>
|
||
<p>et il suffit de créer deux fichier <sc>html</sc>. Un pour se cacher :</p>
|
||
<pre class="sourceCode html"><code class="sourceCode html"><span class="kw"><?xml</span> version="1.0" encoding="utf-8"<span class="kw">?></span>
|
||
<span class="dt"><!DOCTYPE </span>html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"<span class="dt">></span>
|
||
<span class="kw"><html</span><span class="ot"> xmlns=</span><span class="st">"http://www.w3.org/1999/xhtml"</span><span class="ot"> lang=</span><span class="st">"fr"</span><span class="ot"> xml:lang=</span><span class="st">"fr"</span><span class="kw">></span>
|
||
<span class="kw"><head></span>
|
||
<span class="kw"><meta</span><span class="ot"> http-equiv=</span><span class="st">"Content-Type"</span><span class="ot"> content=</span><span class="st">"text/html; charset=UTF-8"</span> <span class="kw">/></span>
|
||
<span class="kw"><script</span><span class="ot"> type=</span><span class="st">"text/javascript"</span><span class="ot"> src=</span><span class="st">"jquery.js"</span><span class="kw">></script></span>
|
||
<span class="kw"><script</span><span class="ot"> type=</span><span class="st">"text/javascript"</span><span class="ot"> src=</span><span class="st">"jquery.cookie.js"</span><span class="kw">></script></span>
|
||
<span class="kw"><script></span>
|
||
<span class="er"> $(document).ready(function(){</span>
|
||
$.<span class="fu">cookie</span>(<span class="ch">'admin'</span>,<span class="dv">1</span>);
|
||
$(<span class="ch">'#info'</span>).<span class="fu">html</span>(<span class="ch">'Analytics can no more see you.'</span>)
|
||
});
|
||
<span class="kw"></script></span>
|
||
<span class="kw"><title></span>Hide to analytics<span class="kw"></title></span>
|
||
<span class="kw"></head></span>
|
||
<span class="kw"><body></span>
|
||
<span class="kw"><div</span><span class="ot"> id=</span><span class="st">"info"</span><span class="kw">></div></span>
|
||
<span class="kw"></body></span>
|
||
<span class="kw"></html></span></code></pre>
|
||
<p>et un autre pour redevenir visible (ça peut être utile) :</p>
|
||
<pre class="sourceCode html"><code class="sourceCode html"><span class="kw"><?xml</span> version="1.0" encoding="utf-8"<span class="kw">?></span>
|
||
<span class="dt"><!DOCTYPE </span>html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"<span class="dt">></span>
|
||
<span class="kw"><html</span><span class="ot"> xmlns=</span><span class="st">"http://www.w3.org/1999/xhtml"</span><span class="ot"> lang=</span><span class="st">"fr"</span><span class="ot"> xml:lang=</span><span class="st">"fr"</span><span class="kw">></span>
|
||
<span class="kw"><head></span>
|
||
<span class="kw"><meta</span><span class="ot"> http-equiv=</span><span class="st">"Content-Type"</span><span class="ot"> content=</span><span class="st">"text/html; charset=UTF-8"</span> <span class="kw">/></span>
|
||
<span class="kw"><script</span><span class="ot"> type=</span><span class="st">"text/javascript"</span><span class="ot"> src=</span><span class="st">"jquery.js"</span><span class="kw">></script></span>
|
||
<span class="kw"><script</span><span class="ot"> type=</span><span class="st">"text/javascript"</span><span class="ot"> src=</span><span class="st">"jquery.cookie.js"</span><span class="kw">></script></span>
|
||
<span class="kw"><script></span>
|
||
<span class="er"> $(document).ready(function(){</span>
|
||
$.<span class="fu">cookie</span>(<span class="ch">'admin'</span>,null);
|
||
$(<span class="ch">'#info'</span>).<span class="fu">html</span>(<span class="ch">'Analytics can see you.'</span>)
|
||
});
|
||
<span class="kw"></script></span>
|
||
<span class="kw"><title></span>Hide to analytics<span class="kw"></title></span>
|
||
<span class="kw"></head></span>
|
||
<span class="kw"><body></span>
|
||
<span class="kw"><div</span><span class="ot"> id=</span><span class="st">"info"</span><span class="kw">></div></span>
|
||
<span class="kw"></body></span>
|
||
<span class="kw"></html></span></code></pre>
|
||
<p>Maintenant en accédant à ces fichiers depuis votre navigateur vous pouvez <em>disparaître</em> des systèmes d’analyses ou bien être considéré comme tous les autres individus. Pensez à accéder à ces fichiers depuis tous les navigateurs que vous utilisez et vos visites ne seront plus comptabilisées.</p>
|
||
</div>
|
||
|
||
<div id="social">
|
||
<span>
|
||
<a class="rss" href="http://feeds.feedburner.com/yannespositocomfr">RSS</a>
|
||
</span>
|
||
<span>
|
||
<a href="https://twitter.com/share" class="twitter-share-button" data-via="yogsototh">Tweet</a>
|
||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
|
||
</span>
|
||
<span>
|
||
<div class="g-plusone" data-size="medium" data-annotation="inline" data-width="106"></div>
|
||
<script type="text/javascript">
|
||
(function() {
|
||
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
|
||
po.src = 'https://apis.google.com/js/plusone.js';
|
||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
|
||
})();
|
||
</script>
|
||
</span>
|
||
<div class="flush"></div>
|
||
</div>
|
||
<div class="corps" id="comment">
|
||
<h2 class="first">Comments</h2>
|
||
<div id="disqus_thread"></div>
|
||
<script type="text/javascript">
|
||
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|
||
var disqus_shortname = 'yannesposito'; // required: replace example with your forum shortname
|
||
|
||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||
(function() {
|
||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
|
||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||
})();
|
||
</script>
|
||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||
</div>
|
||
<div id="bottom">
|
||
<div>
|
||
Published on 2010-06-17
|
||
</div>
|
||
<div>
|
||
<a href="https://twitter.com/yogsototh">Follow @yogsototh</a>
|
||
</div>
|
||
<div>
|
||
Yann Esposito©
|
||
</div>
|
||
<div>
|
||
Done with
|
||
<a href="http://www.vim.org">Vim</a>
|
||
<span class="nicer">&</span>
|
||
<a href="http://jaspervdj.be/hakyll">Hakyll</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
</body>
|
||
<script type="text/javascript" src="../../../../Scratch/js/jquery-1.3.1.min.js"></script>
|
||
<script type="text/javascript" src="../../../../Scratch/js/jquery.cookie.js"></script>
|
||
<script type="text/javascript" src="../../../../Scratch/js/index.js"></script>
|
||
<script type="text/javascript" src="../../../../Scratch/js/highlight/highlight.pack.js"></script>
|
||
<script type="text/javascript" src="../../../../Scratch/js/article.js"></script>
|
||
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||
</html>
|