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

Google Tag Manager consent mode #113

Open
felixgirault opened this issue Oct 22, 2024 · 0 comments
Open

Google Tag Manager consent mode #113

felixgirault opened this issue Oct 22, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@felixgirault
Copy link
Contributor

Provide a preset to setup a GTM integration.

This could mean a custom factory that :

  • provides matching purposes with adequate translations
    {
      purposes: [
        {
          id: 'ad_storage',
          title: 'Ads'
        },
        {
          id: 'analytics_storage',
          title: 'Analytics'
        },
        // …
      ]
    }
  • initializes consents
    gtag('consent', 'default', {
      'ad_storage': 'denied',
      'ad_user_data': 'denied',
      'ad_personalization': 'denied',
      'analytics_storage': 'denied'
    });
  • updates consents
    window.orejime.manager.on('update', (diff) => {
      gtag(
        'consent', 
        'update', 
        mapValues((diff) => consent ? 'granted' : 'denied')
      );
    });

See https://developers.google.com/tag-platform/security/guides/consent?hl=fr&consentmode=advanced#tag-manager_1

@felixgirault felixgirault added the enhancement New feature or request label Oct 22, 2024
@felixgirault felixgirault self-assigned this Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant