• I tried to use it with Google Tag Manager but cookies are set whatever I try to do (including trying to use triggers)?

    • This topic was modified 6 years, 7 months ago by mikaelgislen.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m using Google Tag Manager too and I modified the plugin to fire a custom event for GTM in case of click of the “consent” button or of presence of the cookie. Then I use this event as a trigger for a FB Pixel tag, for example.

    The code to change is in ‘js/scripts.js’.

    I’ve added the following function:
    // GTM
    function consentGivenGTMEvent() {
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push({
    ‘event’: ‘euCookieConsentGiven’
    });
    }

    and called it here:
    if ( euCookieSet > 0) {
    consentGivenGTMEvent(); // GTM
    createCookie();
    }

    and here:
    function euCookieConsent() {
    consentGivenGTMEvent(); // GTM
    createCookie();
    if (autoBlock == 1) {
    window.location = window.location;
    }
    }

    I’m hoping the maintainers will add some support of this kind to GTM, it would be great.

    I was wandering if we can find a workaround.

    If you create a function in functions.php which read the euCookie cookie. If this exists then an event is created so that GTM can fire whatever tag.

    Could it work?

    • This reply was modified 6 years, 5 months ago by valentino86.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to use Google Tag Manager with EU Cookie Law’ is closed to new replies.