Streaming live at 10am (PST)

Problem with using Set cookie code / probleme avec Cookie template


#1

Hi guys

I’m working for a client on a website and i need to show a popup with french grpd law text only one time per session.

I have tried to implement the following example by @vincent : https://webflow.com/website/Webflow-Cookie-Template but the pop-up is always opening when i’m coming back to the home

Here is my website: https://preview.webflow.com/preview/josuat?utm_source=josuat&preview=e91aae89e7dc7bd65c426f54125fe172

Thanks in advance for the help


#2

@Emmanuel_Hourquet take a look at this one


#3

The code you use is different from the code I use on my template.

Also, this implementation is not suitable for GDPR (BTW it’s GDPR in english, RGPD in french, it’s never GRDP :wink: ) With GDPR you gotta get the consent BEFORE setting any cookie. Just saying “Hey we use cookies, you gotta be ok with it” while you have already set the cookie, isn’t making you respect GDPR at all. You gotta get the consent firstn, then set the cookie after that. You also have to offer an alternative for those who don’t want to accept your cookies or analytics. Here, not the technology nor the message used respects GDPR.


#4

Thanks i will check this plugin then


#5

Hi
Yes indeed this is a pain so i will look at the plugin mentionned before

Regarding your code i have only modified the .show() function which is doing display:block into display:flex which can be actually convenient for some people

Regarding the text in the popup this is for now a placed holder and will make sure it is 100% compliant with the eu laws


#6

Isn’t it why it doesn’t work anymore? If I apply your code to my template, it doesn’t work as well.


#7

Well it should not break anything as this is current javascript function but will check again


#8

So i ve now set up a Cookie Consent Pop up for my site: www.derigo.at

The problem is that don’t want to show up the pop up on the bottom of the site - Screenshot below.

Is there any way to get over this?

Thanks in advance.


#9

I also Post the Code Below - I think it has something to do with the last part - Screenshot below:

And here is the whole code:

<script>
    var enableGA = function() {
      (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-128956267-1', 'auto');
      ga('send', 'pageview');
    };
  
    var renderEventMap = function() {
      var $eventMapNode = $('#event-map');
      if ($eventMapNode.length) {
        var query = $eventMapNode.data('query');
        $eventMapNode.replaceWith(
          $('<iframe width="100%" height="100%" frameborder="0" style="border:0" allowfullscreen>')
          	.attr('src', 'https://www.google.com/maps/embed/v1/place?key=YOUR_MAP_KEY_HERE&q=' + query)
        );
      }
    };
  
    var enableCookieConsent = function() {
      enableGA();
      renderEventMap();
      if (window.initFbButton) {
        initFbButton();
      }
    };

    window.addEventListener("load", function() {
        window.cookieconsent.initialise({
            "palette": {
                "popup": {
  "background": "#000000",
  "text": "#ffffff"                    },
                "button": {
                    "background": "#fccc12",
                    "text": "#000000"
                }
            },
            revokable:false,
            "theme": "classic",
            "type": "opt-in",
          
           "content": {
"message": "Die Derigo Installations GmbH verwendet zur Verbesserung Ihrer Surferfahrung Cookies und nützt Google Analytics zu internen Analysezwecken. Wenn Sie wollen können Sie Analytics & die Cookies hier deaktivieren.",
"dismiss": "Cookies deaktivieren",
"allow": "Verstanden",
"link": "Datenschutz",
"href": "https://www.derigo.at/datenschutzerklarung"

},

            onInitialise: function (status) {
              var type = this.options.type;
              var didConsent = this.hasConsented();
              if (type == 'opt-in' && didConsent) {
                // enable cookies
                enableCookieConsent();
              }
              if (type == 'opt-out' && !didConsent) {
                // disable cookies
                // NOTHING TO DO
              }
            },

            onStatusChange: function(status, chosenBefore) {
              var type = this.options.type;
              var didConsent = this.hasConsented();
              if (type == 'opt-in' && didConsent) {
                // enable cookies
                enableCookieConsent();
              }
              if (type == 'opt-out' && !didConsent) {
                // disable cookies
                // NOTHING TO DO
              }
            },

            onRevokeChoice: function() {
              var type = this.options.type;
              if (type == 'opt-in') {
                // disable cookies
                // NOTHING TO DO
              }
              if (type == 'opt-out') {
                // enable cookies
                enableCookieConsent();
              }
            }
        }, function (popup) {
            $('#revoke-cc-btn').on('click', function() {
                popup.revokeChoice();
            });
        })
    });
</script>