Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Google Tag Manager (GTM) plugin to subscribe to "events" for preference changes #3348

Closed
eastandwestwind opened this issue May 22, 2023 · 3 comments · Fixed by #3454
Closed
Assignees

Comments

@eastandwestwind
Copy link
Contributor

eastandwestwind commented May 22, 2023

As a web developer, I want to add the Fides components to my site and have a simple way to automatically trigger events in my Google Tag Manager (GTM) so that I can enforce consent on my tags via GTM.

Details

Basically, we should update the existing Fides.gtm() plugin to automatically subscribe to events

We need to ensure that the GTM data layer is updated whenever the preferences change, including:

  • Initializing the script to “defaults” based on the user’s geolocation
  • User saving their preferences from the modal
  • User rejecting all notices from the banner
  • User accepting all notices from the banner

etc.

AC

  • When I’ve added Fides consent to my site, then I can call window.Fides.gtm() to enable the Google Tag Manager plugin
  • When I’ve enabled the Google Tag Manager plugin, then I should receive an event in GTM when the window.Fides.consent object is initialized
  • When I’ve enabled the Google Tag Manager plugin, then I should receive an event in GTM when the window.Fides.consent object is updated by the user (saving preferences from modal, rejecting notices from banner, accepting notices from banner, etc.)
@eastandwestwind eastandwestwind self-assigned this May 22, 2023
@NevilleS
Copy link
Contributor

Did some quick research and this is super simple - just need to do dataLayer.push({ event: "<event name>", ...eventData })

See https://developers.google.com/tag-platform/tag-manager/web/datalayer

@NevilleS
Copy link
Contributor

NevilleS commented Jun 7, 2023

Closed by #3454

@Roger-Ethyca
Copy link
Contributor

moving to done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants