jmpate / ot-cmp-gcm-template

OneTrust CMP Template
Apache License 2.0
2 stars 4 forks source link

GTM Consent Mode - Incompatibility #2

Closed twslade closed 2 years ago

twslade commented 2 years ago

Hi Onetrust team,

Our team at Elevar have been working extensively with consent mode in GTM. We've found that most CMPs aren't designing their GTM web templates in a way that is compatible with GTM making our merchants lose many hits that should be going to marketing channels.

From Google's Docs

The Consent Initialization trigger is designed to help you ensure that all consent settings are honored before any other triggers fire. The Consent Initialization trigger is used for tags that set or update the user consent state for your site, such as a consent management platform tag or tags that set consent defaults.

The problem I see with the current solution:

  1. User visits homepage. Consent initialization fires with default state (assume everything is denied) https://github.com/jmpate/ot-cmp-gcm-template/blob/bc2e295ace2f62b72ca423f9c36cdd9cb49b19f0/template.tpl#L159-L166
  2. User adjusts consent to "Allow all". Onetrust consent update fires
  3. User clicks to another page.
  4. Consent initialization fires with default state as it did in 1
  5. Data layer pushes occur. Many of the configured tags in GTM do not fire because they fail the consent test which actually isn't the user's choice.
  6. Onetrust Consent update fires

There is a timing issue here. Any persisted consent across page loads should be fired on consent initialization instead of arbitrarily firing depending on load. This can be easily achieved using cookies.

I see a few paths forward here:

simonmadsen commented 2 years ago

ill check the above tomorrow when testing the template

OK I just checked and it is correct, basically the template currently isn't working because the consent-state does not reflect user choices.

Besides, google analytics etc, must be set upon consent, this part also currently does not work.

@twslade please do a PR with improvements I made a simple one with URL fix

simonmadsen commented 2 years ago

Hi Onetrust team,

Our team at Elevar have been working extensively with consent mode in GTM. We've found that most CMPs aren't designing their GTM web templates in a way that is compatible with GTM making our merchants lose many hits that should be going to marketing channels.

From Google's Docs

The Consent Initialization trigger is designed to help you ensure that all consent settings are honored before any other triggers fire. The Consent Initialization trigger is used for tags that set or update the user consent state for your site, such as a consent management platform tag or tags that set consent defaults.

The problem I see with the current solution:

  1. User visits homepage. Consent initialization fires with default state (assume everything is denied) https://github.com/jmpate/ot-cmp-gcm-template/blob/bc2e295ace2f62b72ca423f9c36cdd9cb49b19f0/template.tpl#L159-L166
  2. User adjusts consent to "Allow all". Onetrust consent update fires
  3. User clicks to another page.
  4. Consent initialization fires with default state as it did in 1
  5. Data layer pushes occur. Many of the configured tags in GTM do not fire because they fail the consent test which actually isn't the user's choice.
  6. Onetrust Consent update fires

There is a timing issue here. Any persisted consent across page loads should be fired on consent initialization instead of arbitrarily firing depending on load. This can be easily achieved using cookies.

I see a few paths forward here:

  • We will manage our own version of this Onetrust template that utilizes Onetrust's cookies to initialize consent properly.
  • We will manage another tag that reads the Onetrust cookies above and sets consent
  • We can create a PR to fix this issue.

@twslade @jmpate

jmpate, when will you push my pr live?

twslade if we don't hear from jmpate i think we should make a fork of this code and improve it with my simple url change, and your coding to have full support i have a large danish global customer who can use this, also ill be curious to see how you improve the code or i might do it, but not sure by the way why do you assume that the onetrust team made this template?

twslade commented 2 years ago

twslade if we don't hear from jmpate i think we should make a fork of this code and improve it with my simple url change, and your coding to have full support

@simonmadsen the changes were actually more involved than we expected because of listening for changes from Onetrust required access to addEventListener on the window which wasn't possible in GTM's templates :disappointed:. From what I can tell, the template API's don't support it.

To get around this we had to actually implement a custom HTML tag that would handle setting consent via updateConsentState template API.

There is another issue too with how OneTrust handles auto blocking. If we inject the OneTrust via GTM then the auto blocking will not work as expected because of load order issues. I personally feel like blocking should be handled in GTM and not in OneTrust, but I thought it was worth mentioning.

why do you assume that the onetrust team made this template?

Purely an assumption and I am probably wrong :smile:

jmpate commented 2 years ago

Hello @twslade & @simonmadsen

Updates will be coming to this template soon. Please stay tuned.

simonmadsen commented 2 years ago

Ok at least use my PR with correct url?


From: jmpate @.> Sent: Monday, June 6, 2022 4:42:57 PM To: jmpate/ot-cmp-gcm-template @.> Cc: simonmadsen @.>; Mention @.> Subject: Re: [jmpate/ot-cmp-gcm-template] GTM Consent Mode - Incompatibility (Issue #2)

Hello @twsladehttps://github.com/twslade & @simonmadsenhttps://github.com/simonmadsen

Updates will be coming to this template soon. Please stay tuned.

— Reply to this email directly, view it on GitHubhttps://github.com/jmpate/ot-cmp-gcm-template/issues/2#issuecomment-1147527062, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAJ7WVCXN7JKWIV4IHXF6B3VNYE7DANCNFSM5TY7IFWA. You are receiving this because you were mentioned.Message ID: @.***>

simonmadsen commented 2 years ago

@jmpate (@twslade) shall we assign a timeslot for this and look together? jmpate i know you guys can do it yourself, but im just trying to facilitate here. it would take more time for me to do it than you, and it is your product, i would like to see what you do, but i can just see the code when it's there

i have a client waiting for this

twslade commented 2 years ago

@simonmadsen we integrated this into our product https://app.getelevar.com/. I can give you access to our container if that would help. This will make it so that GTM consent mode works.

simonmadsen commented 2 years ago

@simonmadsen we integrated this into our product https://app.getelevar.com/. I can give you access to our container if that would help. This will make it so that GTM consent mode works.

thx @twslade i know getelevar is a great product, i just hope @jmpate replies for one just foucsing on this part also

jmpate commented 2 years ago

Hey - my team is working on this. We had some disruption due to company re-structuring.

simonmadsen commented 2 years ago

Hey - my team is working on this. We had some disruption due to company re-structuring.

do you have an idea of an ETA? @jmpate

I am working with a client who uses your software, and I want to offer them this improvement which I believe is easier and will give all pageviews data and all conversions but not all traffic sources for those conversions because they will still be missing for people who dont consent for conversions happening after the thank you page and will need to be scaled up to get an accurate picture of traffic source attribution

simonmadsen commented 2 years ago

@jmpate just checking here

jmpate commented 2 years ago

@simonmadsen Thanks for checking in, expect an update EOW

simonmadsen commented 2 years ago

Great!


Fra: jmpate @.> Sendt: Wednesday, July 6, 2022 3:39:28 PM Til: jmpate/ot-cmp-gcm-template @.> Cc: simonmadsen @.>; Mention @.> Emne: Re: [jmpate/ot-cmp-gcm-template] GTM Consent Mode - Incompatibility (Issue #2)

@simonmadsenhttps://github.com/simonmadsen Thanks for checking in, expect an update EOW

— Reply to this email directly, view it on GitHubhttps://github.com/jmpate/ot-cmp-gcm-template/issues/2#issuecomment-1176235124, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAJ7WVBCK3P6ZISZF54A6S3VSWEBBANCNFSM5TY7IFWA. You are receiving this because you were mentioned.Message ID: @.***>

simonmadsen commented 2 years ago

@jmpate does this still apply? meaning did you do some work last week and will it release this week?

simonmadsen commented 2 years ago

@jmpate just checking here again

jordanspilker commented 2 years ago

@jmpate also been following this thread and wondering if there's an update?

jmpate commented 2 years ago

Hello @simonmadsen @jordanspilker - I apologize for the delay - In working with our Google partners, there are additional requirements we need to meet. These will all be made together. Please look for an update next week.

simonmadsen commented 2 years ago

@jmpate @twslade @jordanspilker any update on this?

jordanspilker commented 2 years ago

@jmpate @simonmadsen checking in again

simonmadsen commented 2 years ago

@jmpate @twslade @jordanspilker a co-consultant on this actually implemented the consent themselves. i think it basically works with this cmp here but you 'just' have to define the default consent and a waiting time of 2000 ms, google it and you will find it

still i think it should be part of this git though

jordanspilker commented 2 years ago

thanks @simonmadsen. are you concerned with missing page views or other events that happen in those 2 seconds before the wait time expires?

simonmadsen commented 2 years ago

Not sure. Just waiting for onetrust to update their template


From: jordanspilker @.> Sent: Tuesday, September 27, 2022 10:48:35 PM To: jmpate/ot-cmp-gcm-template @.> Cc: simonmadsen @.>; Mention @.> Subject: Re: [jmpate/ot-cmp-gcm-template] GTM Consent Mode - Incompatibility (Issue #2)

thanks @simonmadsenhttps://github.com/simonmadsen. are you concerned with missing page views or other events that happen in those 2 seconds before the wait time expires?

— Reply to this email directly, view it on GitHubhttps://github.com/jmpate/ot-cmp-gcm-template/issues/2#issuecomment-1260031824, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAJ7WVEA7H4RQGTRO6JQBO3WANMSHANCNFSM5TY7IFWA. You are receiving this because you were mentioned.Message ID: @.***>