Newer Version Available

This content describes an older version of this product. View Latest

Configure the Consent Opt-In Default

To start capturing events to send to Data Cloud, configure your user consent options. By default, Tag Manager doesn’t send data to its destination until the user explicitly opts in. Choose how to present consent options to the site visitor and whether to update the default behavior.

User Permissions Needed
To create an Experience Cloud site: Create and Set Up Experiences AND View Setup and Configuration
To customize an Experience Cloud site:
  • Be a member of the site AND Create and Set Up Experiences

    OR

  • Be a member of the site AND View Setup and Configuration AND an experience admin, publisher, or builder in that site
To publish an Experience Cloud site:
  • Be a member of the site AND Create and Set Up Experiences

    OR

  • Be a member of the site AND an experience admin or publisher in that site

Not all website visitors and customers consent to cookie tracking. With Experience Tag Manager, you can configure whether customers opt in or opt out of tracking. After a user provides consent, and the consent info is passed to your site, Experience Cloud respects the consent preference by sending or not sending data. Any engagement event triggered before a user provides consent is ignored. We recommend using a consent management provider (CMP) application to help manage your consent options.

Tag Manager listens for a specific interaction event called set-consent to capture user consent. Consent is stored as long as the session is active and the page isn’t reloaded. Every time the page is refreshed the consent value must be sent through the set-consent event.

  1. From Setup, in the Quick Find box, enter Digital Experiences, click Digital Experiences, and then click Settings.
  2. Select Security & Privacy.
  3. Under Security Level, select Relaxed CSP: Permit Access to Inline Scripts and Allowed Hosts.
  4. When you’re prompted, allow the change.
  5. Navigate back to Settings and select Advanced.
  6. Click Edit Head Markup and add this script to the existing code.
    1<script>
    2    document.dispatchEvent(
    3        new CustomEvent('experience_interaction', {
    4            bubbles: true,
    5            composed: true,
    6            detail: {
    7                name: 'set-consent',
    8                value: true,
    9            },
    10        })
    11    );
    12</script>
  7. Save your changes and publish your site.

If you’re using a CMP, follow the steps above with the following script and include your CMP’s API as the value attribute.

1<script>
2    document.dispatchEvent(
3        new CustomEvent('experience_interaction', {
4            bubbles: true,
5           composed: true,
6           detail: {
7               name: 'set-consent'
8               value: CMP.getConsent()
9           },
10        })
11    );
12</script>

You can remove user consent by triggering an interaction event with no value specified.

1<script>
2    document.dispatchEvent(
3        new CustomEvent('experience_interaction', {
4            bubbles: true,
5            composed: true,
6            detail: {
7                name: 'set-consent'
8            },
9        })
10    );
11</script>