> For the complete documentation index, see [llms.txt](https://integrations.impact.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://integrations.impact.com/integration-guides/for-brands/tracking-integrations/integrate-consent-mode-on-impact.com.md).

# Integrate Consent Mode on impact.com

Consent Mode on impact.com is designed to adapt tracking behaviors based on the user's consent status, ensuring compliance with the ePrivacy Directive and similar regulations requiring user consent for cookies for tracking and analytics.

This guide covers the client-side integration using the Universal Tracking Tag (UTT). If you're using the Page Load API instead, see the [Page Load API](/brand-api-reference/reference/page-load/page-load.md) reference for details.

{% hint style="success" %}
**Note:** For further information on Consent Mode and how it works, view [Ensure GDPR Compliance using Consent Mode](https://help.impact.com/brand/what-would-you-like-to-learn-about/account-administration/program-settings/tracking-settings/ensure-gdpr-compliance-using-consent-mode).
{% endhint %}

## Prerequisites

* Access to your website's Consent Management Platform (CMP).
* Basic familiarity with JavaScript.
* impact.com account access.
* A [support ticket](https://impact.com/contact/support/) to request that Consent Mode be enabled for your account.

## Implementation steps

{% stepper %}
{% step %}

### Get the Universal Tracking Tag (UTT)

1. From the top navigation bar in impact.com, select ![](https://3238951795-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiVbdCghMC6mw51rrphG6%2Fuploads%2F8Q80VXuJxKrWHbKvvAnf%2FUser%20profile.svg?alt=media\&token=d38dcbc1-c4b7-43e6-a021-64cb0de30cb3) **\[User profile]** → **Settings** → **Tracking** → [**General**](https://app.impact.com/secure/advertiser/fr/general-tracking-settings.ihtml).
2. Below *Universal Tracking Tag*, select **Copy Code**.
3. You can paste the code into a text editor to configure the script in the next section.
   {% endstep %}

{% step %}

### Configure the UTT script

Declare your default consent status *before* the UTT loads, so the tag can't start tracking before a consent signal exists. The recommended way to do this is with `impactDataLayer`, pushed in the page's `<head>` ahead of the UTT script tag:

```html
<script>
  window.impactDataLayer = window.impactDataLayer || [];
  window.impactDataLayer.push(['consent', 'default', { tracking: 'DENIED' }]);
</script>
<script src="https://utt.impactcdn.com/A{UUID}.js" async></script>
```

* Because consent was defaulted to `DENIED` in the example above, impact.com won't yet track this user's active session.
* The *tracking* value isn't case-sensitive. `'DENIED'` and `'denied'` behave identically.
* Choosing `DENIED` or `GRANTED` as your default is a legal decision for your compliance team, not a technical one.

#### Watch the loading order

* The tag will start to run as soon as it loads. If you don't declare a consent default before the `<script src="https://utt.impactcdn.com...">` script tag, the UTT can start tracking before a consent signal is received, resulting in a compliance violation.
* You must declare the default via `impactDataLayer` in the `<head>`, before the UTT loads. This closes the gap and prevents premature tracking on this visit, though it's only one part of a complete consent implementation: it doesn't affect tracking data or cookies from previous visits, and it doesn't replace consent handling elsewhere in your stack.

{% hint style="warning" %}
**Minimum tag version:** This ordering guarantee requires **UTT 3.7.0 or later**. On earlier versions (i.e., UTT 3.6 or earlier), internal on-load actions can run before the `impactDataLayer` push is read.
{% endhint %}

#### Configure without impactDataLayer

If you're not using `impactDataLayer`, you can still declare the default inside the UTT's own script block, before the `ire('identify'` call:

```html
<script type="text/javascript">
(function(a,b,c,d,e,f,g){e['ire_o']=c;e[c]=e[c]||function(){(e[c].a=e[c].a||[]).push(arguments)};f=d.createElement(b);g=d.getElementsByTagName(b)[0];f.async=1;f.src=a;g.parentNode.insertBefore(f,g);})('https://utt.impactcdn.com/AXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX.js','script','ire',document,window);
ire('consent', 'default', {'tracking':'denied'});
ire('identify', {customerid: '' /INSERT CUSTOMER ID/, customeremail: '' /INSERT SHA1 HASHED CUSTOMER EMAIL/});
</script>
```

With this approach, order still matters: firing `identify` before `consent` can cause the tag to track the user without consent.

#### Grant consent

{% tabs %}
{% tab title="Consent Granted" %}
If the user grants consent after the tag has already loaded with a denied default, update the status:

```javascript
ire('consent', 'update', {'tracking':'granted'})
```

At this point the UTT:

* will place tracking cookies.
* will send user identity data to the server.
  {% endtab %}

{% tab title="Consent Denied" %}
If the user denies consent, update the status:

```javascript
ire('consent', 'update', {'tracking':'denied'})
```

At this point, the UTT:

* Won't create persistent tracking cookies or send tracking or user identity data to the impact.com server.
* Won't collect any tracking data, except for data related to loyalty/rewards events.
* Will send a profiling request with `consentStatus: denied` to the impact.com server.
* If the `im_rewards` flag is set, place cookies and send the current event to the server.
  {% endtab %}
  {% endtabs %}

#### Watch for these common pitfalls

* **Incorrect Sequencing**: Firing `identify` before `consent` is the most common integration error. This causes the tag to default to standard tracking, ignoring the user's opt-out.
* **Plain Text Emails**: Always ensure the `customeremail` is hashed using SHA-1 before sending it to protect user privacy.
  {% endstep %}

{% step %}

### Deploy the UTT

Place the UTT with `consent` and `identify` functions invoked on all pages.
{% endstep %}

{% step %}

### Send conversions

Continue to send conversions via the UTT whether a user has or hasn't provided consent. The tag adjusts what data it sends based on the consent status.

{% tabs %}
{% tab title="Consent Granted" %}
Here's an example of sending a conversion when consent is `GRANTED`:

```html
<script>
  window.impactDataLayer = window.impactDataLayer || [];
  window.impactDataLayer.push(['consent', 'default', { tracking: 'GRANTED' }]);
  window.impactDataLayer.push(['trackConversion', XXXXXX, {properties}, {options}]);
</script>
<script src="https://utt.impactcdn.com/A{UUID}.js" async></script>
```

{% endtab %}

{% tab title="Consent Denied" %}
Here's an example of sending a conversion when consent is `DENIED`:

```html
<script>
  window.impactDataLayer = window.impactDataLayer || [];
  window.impactDataLayer.push(['consent', 'default', { tracking: 'DENIED' }]);
  window.impactDataLayer.push(['trackConversion', XXXXXX, {properties}, {options}]);
</script>
<script src="https://utt.impactcdn.com/A{UUID}.js" async></script>
```

{% endtab %}
{% endtabs %}

If you're using our Conversions API to send conversions, see [Send Conversions with Consent Mode](/integration-guides/for-brands/tracking-integrations/api-online-sale/send-conversions-with-consent-mode.md).
{% endstep %}
{% endstepper %}

## Additional considerations

### Privacy-compliant tracking for Loyalty and Rewards partners

* In regions where privacy laws restrict tracking cookies unless explicit user consent is given, brands may face challenges in tracking and attributing user interactions. However, there are scenarios where tracking is considered strictly necessary for the delivery of a service requested by the user, such as for rewards programs.
* CMWith Consent Mode, brands can allow tracking for loyalty and rewards programs even if the user doesn't provide explicit consent. This ensures continuous and accurate tracking for essential services without violating privacy laws.
* To do this, loyalty and rewards partners pass a query string parameter called `im_rewards=1`. During the click, impact.com verifies that the parameter was passed by a partner that runs loyalty and rewards programs.
* Brands must ensure this parameter is carried through to the landing page, similar to tracking parameters like `clickid`.
* Once `im_rewards=1` is identified by our JavaScript tag, the tag will automatically track the referral for the user even when consent is not provided.

### Pings

The impact.com JavaScript tag sends anonymous ping events to help brands and partners understand the impact of non-consented users on marketing performance.

* These pings are sent to a different domain to avoid sending tracking cookies and are not used to track the user or credit a partner.
* Pings only contain basic information about the referral and do not identify the user.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://integrations.impact.com/integration-guides/for-brands/tracking-integrations/integrate-consent-mode-on-impact.com.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
