title: Google Analytics Opt-out
body: <p>To be OK with the nonsense cookie law of the Grosse European Komission, I've built this little script to opt-out the GA tracking code. The result is a popup asking once in the session for OK vs CANCEL GA. What do you think of it?</p>
  
  <pre><code>(function() {
    var message = "GOOGLE ANALYTICS COOKIE\nCookie or not cookie, that is the question\n\nI opt for Google Analytics pageview anonymous tracking.\n\nJe consens au suivi d'audience anonyme Google Analytics.";
    if (!sessionStorage['key_name']) {
      if (confirm(message) == true) {
       sessionStorage.setItem('key_name', 'gaOK');
      }
      else {
       sessionStorage.setItem('key_name', 'gaOut');
      }
    }
    if (sessionStorage['key_name'] == 'gaOK') {
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  
      ga('create', 'UA-XXXXXXXX-N', 'auto');
      ga('send', 'pageview');
    }
  })();
  </code></pre>