Quantcast
Channel: Allgemein - Shopware Community Forum
Viewing all articles
Browse latest Browse all 4666

Google Analytics Code erweitern

$
0
0

Hallo zusammen,

ich muss einen Javascript-Code vor dem Analytics Code im Quelltext einbinden, um ein Cookie Opt-Out zu ermöglichen. Kann mir jemand sagen, wie ich das einbinden muss?

<script>
// Set to the same value as the web property used on the site
var gaProperty = 'UA-XXXXXX-Y';
var disableStr = 'ga-disable-' + gaProperty;

// Disable tracking if the opt-out cookie exists.
if (document.cookie.indexOf(disableStr + '=true') > -1) {
  window[disableStr] = true;
}

// Opt-out function
function gaOptout() {
document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
window[disableStr] = true;
}
</script>

 


Viewing all articles
Browse latest Browse all 4666


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>