Blog

Howto add Google Analytics Opt-out Notification to your website

 

Add Google Analytics optOUT to your SPIP website

your SPIP template should include one file called "stats_GA.html" Then in your article or/and section template add between <head></head>   <INCLURE{fond=inclus/stats_GA}> then copy/paste this code into stats_GA.html and adjust it [(#REM) code analytics ] <script type="text/javascript"> gaProperty = 'UA-4154820-XXXX' var disableStr = 'ga-disable-' + gaProperty; if (document.cookie.indexOf('hasConsent=false') > -1) { window[disableStr] = true; } function getCookieExpireDate() { ...
More