Coder Social home page Coder Social logo

Comments (2)

featdd avatar featdd commented on July 23, 2024

Hi @mikeemike7,

I what do you mean exactly?
You still have to add the script for Google Analytics etc. by yourself, therefore you would be able to adjust the integration as you like.

As I'm understanding THIS right you would always load analytics but with denied consent by default like this:

<script async src="//www.googletagmanager.com/gtag/js?id=UA-XXXXXX-XX" data-ignore="1"></script>
<script data-ignore="1">
  window.dataLayer = window.dataLayer || [];

  function gtag() { dataLayer.push(arguments) }

  gtag("consent", "default", { ad_storage: "denied", analytics_storage: "denied" });

  gtag('js', new Date());
  gtag('config', 'UA-XXXXXX-XX', { 'anonymize_ip': true });
</script>

Then you could add the consent event to update the consent mode:

<script data-ignore="1">
  window.cookieConsentLoadedGoogleAnalytics = false;
  window.addEventListener('cookieConsent', function (event) {
    if (
      false === window.cookieConsentLoadedGoogleAnalytics &&
      event.detail.hasOption('google_analytics')
    ) {
      gtag("consent", "update", { ad_storage: 'granted', analytics_storage: 'granted' });
    }
  });
</script>

But honestly I'm not sure about the legal safety, as I can't give you legal information you should still consultate your privacy lawyer for this.

When I'm currently integrating a consent I completely withhold the loading of the external scripts to be safe there, like this:

<script data-ignore="1">
  window.cookieConsentLoadedGoogleAnalytics = false;
  window.addEventListener('cookieConsent', function (event) {
    if (
      false === window.cookieConsentLoadedGoogleAnalytics &&
      event.detail.hasOption('google_analytics')
    ) {
      let script = document.createElement('script');

      script.async = true;
      script.src = '//www.googletagmanager.com/gtag/js?id=UA-XXXXXX-XX';

      document.head.appendChild(script);

      window.cookieConsentLoadedGoogleAnalytics = true;
      window.dataLayer = window.dataLayer || [];
      function gtag() {dataLayer.push(arguments)}
      gtag('js', new Date());
      gtag('config', 'UA-XXXXXX-XX', { 'anonymize_ip': true });
    }
  });
</script>

Overall this looks more like an individual legal question to me rather then an adjustment/feature for this extension...
I hope this answer still helps you out.

Merry christmas
Daniel

from mindshape_cookie_consent.

mikeemike7 avatar mikeemike7 commented on July 23, 2024

Hi Daniel,
many thanks for your detailed response. It was a technical question, not a legal one*.
The Problem for Google Ads-Customers is, not every user is willing to give consent. The annoying banner is just clicked away so that it's not possible to measure the success of your Ads.
I supposed, the Consent Mode-Api might be a good idea: if I understood that correctly, the Google Consent Mode provides no personal data, just aggregated data with - so performance measurement could also be possible without consent and without setting of cookies. In that case it could at least be enough to evaluate the success of an Ads campaign.
*But I think you are right - from a legal point of view still servers in the USA are contacted - without consent...
Merry Christmas
Mikee

from mindshape_cookie_consent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.