Coder Social home page Coder Social logo

Comments (5)

featdd avatar featdd commented on July 23, 2024

HI @derBoogie,

how do you mean this exactly?

The event will only be triggered on load if a consent cookie already exists.
Otherwise the the event will be triggered after the user submits the consent in the modal form.

You may also have a look into the official documentation.

Greetings
Daniel

from mindshape_cookie_consent.

derBoogie avatar derBoogie commented on July 23, 2024

Hi Daniel,

in my cookie-consent.js, which is loaded on every page I have:

$(document).ready(function() {

  window.googleAnalyticsLoaded = false;
  window.addEventListener('cookieConsent', function (event)
  {
    if (event.detail.hasOption('google_analytics'))
    {
      if (false === window.window.googleAnalyticsLoaded)
      {
        window.googleAnalyticsLoaded = true;
        console.log('Load Google Analyitcs');
      }
    }
  });

});

In console I can see "Load Google Analyitcs" if I accept the google_analtics cookie (check checkbox and save), which works fine.
But when I continue surfing the page, "Load Google Analyitcs" is not displayed in the console. I.e. on load the cookie_consent event is not fired.
Here you can see the value of cookie "cookie_consent":
grafik

Greetings
TJ

from mindshape_cookie_consent.

featdd avatar featdd commented on July 23, 2024

Hi @derBoogie,

You have to implement the explicit loading of analytics or other tools by yourself, the extension just offers you the consent mechanics, analytics ist just meant as an example in the documentation.

You may want to have a look at an concrete example, this loads Google Analytics Universal if the user consented to.

Greetings
Daniel

from mindshape_cookie_consent.

derBoogie avatar derBoogie commented on July 23, 2024

Hi Daniel,

thanks for your quick reply.

I've already implemented an own solution for the "on load mechanism" of cookies which are allowed by th user.
That means, which are stored in the cookie_consent cookie.

In my opinion this should be part of your extension, because It's an essential feature.

Greetings
TJ

from mindshape_cookie_consent.

featdd avatar featdd commented on July 23, 2024

Hi @derBoogie,

the mechanism is already there, I don't know why you did your own, see the link to the example I posted earlier.

The extension doesn't automaticely block any scripts or something, it provides the functionality to load your analytics (google, matomo or whatever) only if the user consented.

Greetings
Daniel

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.