wellcomecollection / wellcomecollection.org

🪟 Wellcome Collection's website and services that support it
https://wellcomecollection.org
MIT License
37 stars 5 forks source link

Custom html tags not firing on first page after consent given #10953

Closed LaurenFBaily closed 1 week ago

LaurenFBaily commented 3 weeks ago

What

Same issue as #10949 but we think a different solution needed for our custom html tags.

Possible solutions from Slack chat

  1. Create a new event/trigger that looks at the consent state in the data layer eg.https://github.com/Ayudante/gtm-consent-state
  2. Move custom html tags out of GA into our codebase and manage triggering them ourselves from the civicuk consent change callbacks
rcantin-w commented 2 weeks ago

Pausing this until I can ask Gareth about the "Performance timing tracking" script, David and I aren't sure what it's used for, wondering if it was pre-Core web vitals.

Also need to ponder a bit more on the scripts not being removed/added on consent changes, but on the page next page load. Do we mind?

rcantin-w commented 2 weeks ago

PR is almost ready to go, if not completely, but the Pixel Tracking expected behaviour makes me question if we do want to merge this in as is or go back on our decision to put all Custom HTML tags in the codebase.

Lauren to reach out to Trust to see how they've dealt with this.

rcantin-w commented 2 weeks ago

Both the scripts we currently have in GTM can be added in without depending on consent as they do not set any cookies.

rcantin-w commented 1 week ago

Changes now in prod, they should fire all the time (unless no javascript) as there is no consent requirements anymore. I will now delete them from GTM.