• Hi there,

    We are using the plugin on a new site. We have the standard GTM head and body code on our site except the domain is custom first party so:

    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;
    j.src='https://domain.be/som/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-NDPN2SS');</script>
    <!-- End Google Tag Manager -->

    The WPconsent plugin does not seem to scan this and configure it. Thus not activation consent mode.
    Is there a way to get it working with these server side configs?

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @dieterj,

    Thank you for reaching out. WPConsent will automatically load the Google Consent Mode scripts if a Google service is configured on your website. So if you go in wp-admin > WPConsent > Settings > Cookies and add a service named Google Tag Manager or Google Analytics, for example, to the appropriate category, WPConsent will then know to load the consent mode script.

    This type of check is needed because the consent mode script is loaded very early on the page and we only want to load it for those websites that really need it.

    Let me know if you run into any issues.

    Thanks,
    Mircea

    Hi @gripgrip ,

    Thanks! this worked. How do need to map the cookies set by GTM?
    For example:

    GTM has a Google Analytics 4 tag that loads on page after consent with consent mode.
    This adds the ga_ cookies in the browser of the user but it is not found via the scanner?

    Thanks
    Dieter

    Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @dieterj,

    Yes, that is happening because GA4 is not directly loaded on your site, it’s loaded through GTM.

    WPConsent doesn’t currently have a way to detect the tags loaded through GTM.

    You can manually configure the details for GA4 cookies by adding a new service and cookie info in the Cookies tab of WPConsent. https://cookielibrary.org/service/google-analytics/

    If your site loaded GA4 directly on the website, WPConsent would automatically detect it and configure it from our public library linked above.

    Perfect, thank you!

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.