> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runconverge.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Consent

> Track visitor consent to Converge

export const OutboundLink = ({linkText, linkTarget}) => {
  return <a target="_blank" href={linkTarget}> {linkText} 
    <div className="inline h-3 w-3 fill-gray-500 dark:fill-gray-100 text-gray-500 dark:text-gray-300 ml-1 mr-1">
      <svg className="inline w-2.5 h-2.5 bg-gray-500 dark:bg-gray-300" style={{
    maskImage: `url('https://mintlify.b-cdn.net/v6.5.1/solid/up-right-from-square.svg')`,
    maskRepeat: "no-repeat",
    maskPosition: "center center"
  }}></svg> 
    </div>
    </a>;
};

export const IconText = ({name, text, iconSource = "mintlify", iconLocation = "before", iconType = "solid"}) => {
  const sourceUrl = iconSource === 'local' ? `url('/images/icons/${name}.svg')` : `url('https://mintlify.b-cdn.net/v6.5.1/${iconType}/${name}.svg')`;
  return <>
            <div className="inline-block pl-2">
                {iconLocation === 'before' && <div className="h-3.5 w-3.5 fill-gray-800 dark:fill-gray-100 text-gray-800 dark:text-gray-100 inline-block align-middle mr-2">
                        <svg className="w-4 h-4 bg-gray-800 dark:bg-gray-100 " style={{
    maskImage: sourceUrl,
    maskRepeat: "no-repeat",
    maskPosition: "center center"
  }} />
                    </div>}
                <span className="inline-block align-middle font-semibold fill-gray-800 dark:fill-gray-100 text-gray-800 dark:text-gray-100 pl-1 pr-2">{text}</span>
                {iconLocation === 'after' && <div className="h-3.5 w-3.5 fill-gray-800 dark:fill-gray-100 text-gray-800 dark:text-gray-100 inline-block align-middle mr-2">
                        <svg className="w-4 h-4 bg-gray-800 dark:bg-gray-100 pr-3" style={{
    maskImage: sourceUrl,
    maskRepeat: "no-repeat",
    maskPosition: "center center"
  }} />
                    </div>}
            </div>
        </>;
};

## Overview

You can configure how the Converge destinations should behave based on the visitor's consent preferences.
To set this up, you need to send the consent to Converge.

You still need a CMP, cookie banner provider, or your own solution to collect the preference.

While this allows you to configure how destinations handle consent,
regardless of the configured consent, events will still be sent to Converge.

<Warning>This documentation describes implementing Consent for Converge. It does not implement Google or Microsoft Consent Mode. Read [this](/guides/implementing-consent-mode) guide for implementing Google and Microsoft Consent Mode.</Warning>

## The consent method

The `cvg` object has a `consent` method that you can use to send the visitor's consent preferences to Converge.
It takes two arguments. We recommend always sending both.

* `analytics`:
  Preference for analytics tracking. Possible values are `granted`, and `denied`.
  If not set, Converge will assume that the visitor has `denied` consent.
* `marketing`:
  Preference for marketing tracking. Possible values are `granted`, and `denied`.
  If not set, Converge will assume that the visitor has `denied` consent.

See the examples below.

<AccordionGroup>
  <Accordion icon="chart-simple" title="The visitor has granted consent for only analytics tracking">
    ```javascript theme={null}
    cvg({ 
        "method": "consent",
        "analytics": "granted",
    })
    ```
  </Accordion>

  <Accordion icon="chart-simple" title="Equivalent to granting consent for only analytics tracking">
    ```javascript theme={null}
    cvg({
        "method": "consent",
        "analytics": "granted",
        "marketing": "denied",
    })
    ```
  </Accordion>

  <Accordion icon="envelopes-bulk" title="The visitor has granted consent for both analytics and marketing tracking">
    ```javascript theme={null}
    cvg({
        "method": "consent",
        "analytics": "granted",
        "marketing": "granted",
    })
    ```
  </Accordion>

  <Accordion icon="radiation" title="The visitor has denied consent for both analytics and marketing tracking">
    ```javascript theme={null}
    cvg({
        "method": "consent",
        "analytics": "denied",
        "marketing": "denied",
    })
    ```
  </Accordion>
</AccordionGroup>

<Note>
  You need to make sure the `cvg` object is available before you call the `consent` method.
  If this is not the case, include the following snippet before calling `cvg`.

  ```javascript theme={null}
  window.cvg||(cvg=function(){cvg.process?cvg.process.apply(cvg,arguments):cvg.queue.push(arguments)},cvg.queue=[]);
  ```
</Note>

## Storing consent

Consent should be sent every time the user visits the page.
Typically, you will rely on your CMP or own cookie banner implementation to retrieve the visitor's consent and send it to Converge.

Converge stores the consent preferences in the visitor's browser as a backup.
But, to make sure that it is up-to-date, you should still specify it every time the converge snippet loads.

The preferences are also stored on the Converge **profile**, under the `profile_properties`.
This is used to filter events when forwarding server-side.

<Accordion title="Inspect the consent parameters for a profile">
  The consent preferences are stored in the **profile properties**, under the `$consent` key. This object is used to filter the server-side events.

  ```json profile_properties theme={null}
  {
      ...
      "$consent": {
          "analytics": "granted",
          "marketing": "denied"
      }
  }
  ```
</Accordion>

## Automatic CMP integrations

Converge automatically detects and integrates with popular Consent Management Platforms (CMPs). When one of these CMPs is present on your page, Converge will automatically read the visitor's consent preferences and apply them—no additional code required.

<Note>
  This integration handles Converge's consent tracking. If you're using Google Ads, GA4, or Microsoft Ads, you'll also need to implement Google and Microsoft Consent Mode. Read the [Implementing Consent Mode guide](/guides/implementing-consent-mode) to learn how to set this up with your CMP.
</Note>

### Supported CMPs

The following CMPs are automatically detected and integrated:

<AccordionGroup>
  <Accordion title="Avada (Shopify)">
    Converge automatically integrates with Avada's cookie consent banner on Shopify stores. The integration:

    * Detects Avada's consent banner using the Shopify Customer Privacy API
    * Maps analytics and marketing consent from Shopify's consent framework
    * Updates automatically when visitors change their consent preferences

    No additional configuration is needed if you're using Avada on Shopify.

    <Info>
      For Google Ads and GA4, you'll also need to implement Google Consent Mode. See the [Shopify Cookie Banner implementation example](/guides/implementing-consent-mode#examples) in the Consent Mode guide.
    </Info>
  </Accordion>

  <Accordion title="Cookiebot">
    Converge automatically integrates with Cookiebot's consent framework. The integration:

    * Maps Cookiebot's `statistics` category to Converge's `analytics` consent
    * Maps Cookiebot's `marketing` category to Converge's `marketing` consent
    * Listens for the `CookiebotOnConsentReady` event to capture consent updates

    No additional configuration is needed if you're using Cookiebot.

    <Info>
      For Google Ads and GA4, you'll also need to implement Google Consent Mode. See the [Cookiebot implementation example](/guides/implementing-consent-mode#examples) in the Consent Mode guide.
    </Info>
  </Accordion>

  <Accordion title="CookieFirst">
    Converge automatically integrates with CookieFirst's consent banner. The integration:

    * Maps CookieFirst's `performance` category to Converge's `analytics` consent
    * Maps CookieFirst's `advertising` category to Converge's `marketing` consent
    * Listens for the `cf_consent` event to capture consent updates
    * Waits for the CookieFirst banner to load before reading consent

    No additional configuration is needed if you're using CookieFirst.

    <Info>
      For Google Ads and GA4, you'll also need to implement Google Consent Mode. See the [custom implementation examples](/guides/implementing-consent-mode#examples) in the Consent Mode guide for help integrating CookieFirst with Google Consent Mode.
    </Info>
  </Accordion>

  <Accordion title="Cookie Information">
    Converge automatically integrates with Cookie Information's consent platform. The integration:

    * Maps Cookie Information's `cookie_cat_statistic` category to Converge's `analytics` consent
    * Maps Cookie Information's `cookie_cat_marketing` category to Converge's `marketing` consent
    * Listens for the `CookieInformationConsentGiven` event to capture consent updates

    No additional configuration is needed if you're using Cookie Information.

    <Info>
      For Google Ads and GA4, you'll also need to implement Google Consent Mode. See the [custom implementation examples](/guides/implementing-consent-mode#examples) in the Consent Mode guide for help integrating Cookie Information with Google Consent Mode.
    </Info>
  </Accordion>

  <Accordion title="CookieYes">
    Converge automatically integrates with CookieYes's consent banner. The integration:

    * Maps CookieYes's `analytics` category to Converge's `analytics` consent
    * Maps CookieYes's `advertisement` category to Converge's `marketing` consent
    * Listens for the `cookieyes_consent_update` event to capture consent changes
    * Waits for the CookieYes banner to load before reading consent

    No additional configuration is needed if you're using CookieYes.

    <Info>
      For Google Ads and GA4, you'll also need to implement Google Consent Mode. See the [CookieYes implementation example](/guides/implementing-consent-mode#examples) in the Consent Mode guide.
    </Info>
  </Accordion>

  <Accordion title="OneTrust">
    Converge automatically integrates with OneTrust's consent framework. The integration:

    * Maps OneTrust's category C0002 (Performance) to Converge's `analytics` consent
    * Maps OneTrust's categories C0004 (Targeting) and C0005 (Social Media) to Converge's `marketing` consent
    * Integrates with the `OptanonWrapper` callback to capture consent updates

    No additional configuration is needed if you're using OneTrust.

    <Info>
      For Google Ads and GA4, you'll also need to implement Google Consent Mode. See the [custom implementation examples](/guides/implementing-consent-mode#examples) in the Consent Mode guide for help integrating OneTrust with Google Consent Mode.
    </Info>
  </Accordion>

  <Accordion title="Usercentrics">
    Converge automatically integrates with Usercentrics's consent platform. The integration:

    * Maps Usercentrics's `functional` category to Converge's `analytics` consent
    * Maps Usercentrics's `marketing` category to Converge's `marketing` consent
    * Listens for the `UC_CONSENT` event to capture consent updates
    * Waits for the Usercentrics CMP to load before reading consent

    No additional configuration is needed if you're using Usercentrics.

    <Info>
      For Google Ads and GA4, you'll also need to implement Google Consent Mode. See the [custom implementation examples](/guides/implementing-consent-mode#examples) in the Consent Mode guide for help integrating Usercentrics with Google Consent Mode.
    </Info>
  </Accordion>
</AccordionGroup>

<Note>
  If you're using one of these CMPs, you don't need to manually call the `cvg` consent method. Converge will automatically detect the CMP and sync consent preferences. However, you can still manually call the consent method if you need to override or supplement the automatic integration.
</Note>

### Limitations

The automatic CMP integrations have a few limitations to be aware of:

* **Loading order**: The CMP must load and initialize before Converge can read consent preferences. Most integrations include timeout logic (typically 5 seconds) to wait for the CMP to load.
* **Category mapping**: Converge only tracks two consent categories (`analytics` and `marketing`). Additional categories from your CMP are not captured.
* **Custom configurations**: If you've customized your CMP category names or structure, the automatic integration may not work correctly. Use the manual consent method instead.

## Sending consent

When Converge has not received any consent preferences, we will default to `denied` consent.
For that reason, we recommend calling the consent method before the Converge snippet.

```html Configuring consent before the tracking theme={null}
<script src="https://static.runconverge.com/pixels/xxxxxx.js" async></script>
<script>
    window.cvg||(cvg=function(){cvg.process?cvg.process.apply(cvg,arguments):cvg.queue.push(arguments)},cvg.queue=[]);
    cvg({
        "method": "consent",
        "analytics": "granted",
        "marketing": "granted",
    })
    cvg({method:"track", eventName:"$page_load"});
</script>

```

## Default consent

The Converge consent can be updated while the visitor is browsing the page.
To set a default consent, you can simply call the `consent` method with the static default preferences -- and later on, update them as follows.

```javascript Default to granted consent until the visitor denies marketing theme={null}
cvg({ 
    "method": "consent",
    "analytics": "granted",
    "marketing": "granted",
})

// When the visitor denies marketing
function denyMarketing() {
    cvg({ 
        "method": "consent",
        "analytics": "granted",
        "marketing": "denied",
    })
}
```

## Identifiers

The Converge pixel leverages the following identifiers in every setup.

| Name            | Method | Description                                                                                                                                                                          |
| --------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `__cvg_uid`     | Cookie | Unique identifier for the user                                                                                                                                                       |
| `__cvg_sid`     | Cookie | Unique identifier for the current session                                                                                                                                            |
| `__cvg_session` | Cookie | Information about the current session. It's used to ensure consistency of the session properties sent to Converge and to trigger new sessions based on changing tracking parameters. |

The following identifiers are only used for specific destinations.

| Name                | Destination | Method | Description            |
| ------------------- | ----------- | ------ | ---------------------- |
| `__cvg_tblcid`      | Taboola     | Cookie | Click ID from Taboola  |
| `__cvg_mgidcid`     | MGID        | Cookie | Click ID from MGID     |
| `__cvg_sccid`       | Snapchat    | Cookie | Click ID from SnapChat |
| `__cvg_awc`         | AWIN        | Cookie | Click ID from AWIN     |
| `__cvg_outbraincid` | Outbrain    | Cookie | Click ID from Outbrain |

The following identifiers are only used when Converge consent integration is active.

| Name                      | Method        | Description                         |
| ------------------------- | ------------- | ----------------------------------- |
| `__cvg_consent_analytics` | Local Storage | User consent for analytics purposes |
| `__cvg_consent_marketing` | Local Storage | User consent for marketing purposes |
