Can anyone use GTM custom pixel with Google Consent Mode v2?

Is anyone of you using GTM custom pixel and managed to implement a Cookie Banner that’s compatible with Google Consent Mode v2? I’ve tried coockiebot, but no luck.

Hi @Dabrowka facing the same issue. I have tried few other cookie apps but same problem will update if i find a solution

Hey Robiulawoalraju :slightly_smiling_face:

the screenshots you sent can’t come from a GTM custom pixel because the preview doesn’t work with this kind of GTM integration. The cookie banner does not apper after creating and publishing tag with coockiebot ID.

I think you’ll need to place the consent system in the theme itself. Have the pixel read an associated cookie from the parent page for your “default” Google Consent, and then set up a custom event for whenever the consent system updates - having the pixel listen for that custom event for the “update” Google Consent.

did you try the basic cookie consent setup?or advance?

Hi!

did you found a solution? Trying as well to find one..

We have the same problem, we used to set default and update commands trough Simo Ahava’s consent mode v2 tag in GTM. The tag is not working correctly anymore, which requires a page load for it to send the update commands correctly, even if the cookies are correctly placed and the trigger is set to fire update command after users accepts cookies.

We’re currently looking into switching the implementation to the theme as well, meaning that default will be sent from the Custom Pixel and update command will be sent in each page after cookie choices are there (or users’ accept the cookies in that page) I’ll update here if that works.

We are now using the solution from Elevar as App. Works fine since one week. Consent Mode v2 is fully used there. Setup was very easy done :slightly_smiling_face:

We made the decision to not go with that initially before we were switching to Checkout Extensibility. Now I regret not moving with that option, would make our lives way easier for sure. If nothing works, most likely will switch to Elevar as well.

Hi Taimoor99, have you found a solution yet? I’m still struggling…

Hi, is there any instruction on how to do it step by step? it sounds super complicated for me… Or do you know how to do it? I will be happy to hire someone who knows how it’s done :sweat_smile:

i think ive tried everything :wink: the gtm pixel is limited so i can’t make a cookie baner visible with GTM and when I use shopify apps they don’t work with custom pixels for some reason, the pixel fires either way

still not, did you?

did it work?

yeah that’s quite expensive solution, isn’t it?

Hi @Dabrowka ,I did a custom solution with our developer and it works now with Custom Pixel. Here are steps:

  1. Default command is triggered within the Custom Pixel and always set to “denied”.

  2. I use Simo Ahava’s consent update command within GTM and trigger it on “initialization”. For the variables analytics, ad_storage etc. I first look into if the cookie that CMP sets there and get the values there, if not I’ll get the values from dataLayer from OneTrustGroupsUpdate event, otherwise it sets to “denied”.

  3. Our developer pushes all the consent events to dataLayer after the cookies are accepted/rejected. Developer also sends “update” command after those events are set within the Custom Pixel. You need to make sure the default command is on top of the Custom Pixel and then update command is somewhere next to where you send the page_viewed event.

By doing so we made sure that the cookie consent is always set to denied and then if the user has already accepted cookies we send the CMP event and update event immediately so that we track the user. Also when the users first land into your website and accept cookies, that’s when we again send update command so that all tracking intact. I quite honestly don’t remember why we both have update tag in GTM and also in the custom pixel, but since the solution worked I didn’t change and question it further. Hope this helps.

We use OneTrust and the script is within the theme itself. It should not be setup via GTM or a pixel as you need to make sure whatever platform you use always triggers before other scripts, so in the theme itself.

Could you share a bit more info about what “Simo Ahava’s consent update command within GTM” is? I’m also struggling with this. It seems like a very incomplete solution at the moment.

Subscribing to this topic too - as we need the flexibility of our own Web Pixel based GTM solution - and blend with Consent Mode 2.0. My current thoughts are that we need to implement the Cookie Management Platform within the theme layer (as it won’t display from within a sandbox right?) - then pass any events from the CMP into the Web Pixel by way of a custom event. I also believe that cookies can be read from the parent DOM inside the Web Pixel code - but need to confirm that through testing. Still not migrated away from checkout.liquid yet - as has been proven here - the Web Pixel approach is still being activelty developed…