---
updatedAt: 2026-09-29T23:38:36.000Z
agentTools:
  projectIndex: https://dev.kevel.com/llms.txt
---

# GDPR Compliance and Consent Settings

How to pass GDPR consent to Kevel on Decision API requests, UserDB records and IAB consent strings, and which setting takes precedence.

This document describes specific integration instructions to ensure compliance with the European Union's General Data Protection Regulation (GDPR).

Please refer to our [Kevel & GDPR doc](https://dev.kevel.com/docs/gdpr-kevel) for a high-level overview of how to prepare for the GDPR.

## Setting Consent on the Ad Request - Decision API

To set GDPR consent on a Decision API request, add a top-level `consent` object:

```
"consent": {"gdpr": true}
```

<Callout icon="❗️" theme="error">
  Note that GDPR consent will default to false unless it is explicitly set.
</Callout>

An example Decision API request with consent set to true:

```json
{
  "consent": {
    "gdpr": true
  },
  "placements": [
    {
      "divName": "div1",
      "networkId": 1234,
      "adId": 12345,
      "siteId": 12345,
      "adTypes": [
        5
      ]
    }
  ]
}
```

<Callout icon="📘" theme="info">
  Frequency capping, attribution, and RTB user matching will not work for EU users unless consent is set. See below for details. If Kevel's relevancy model is enabled for your network, it also does not use personalized relevancy scores for these users. See [Kevel's relevancy model](https://dev.kevel.com/docs/relevancy-score#kevels-relevancy-model).
</Callout>

## Setting Consent on UserDB

<Callout icon="👍" theme="okay">
  If consent is not set on the user record OR the request, and the request originates from the EU, then no data from the user record can be used for ad targeting.
</Callout>

You can set GDPR consent for a specific user in UserDB with the [GDPR Consent Endpoint](https://dev.kevel.com/reference/gdpr-consent). The consent status will be honored anytime the UserKey is used in a request.

## Setting Additional Consent and Regulatory Parameters

In addition to the `gdpr` parameter, there are optional parameters in the `consent` object that will set consent within Kevel, declare a user subject to GDPR or pass consent to downstream providers.

<HTMLBlock>{`
<table style="width: 100%; border-collapse: collapse;">
<thead>
<tr>
  <th style="border: 1px solid #ddd; padding: 8px;">Parameter</th>
  <th style="border: 1px solid #ddd; padding: 8px;">Type</th>
  <th style="border: 1px solid #ddd; padding: 8px;">Description</th>
  <th style="border: 1px solid #ddd; padding: 8px;">Example</th>
</tr>
</thead>
<tbody>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p><code>gdprConsentString</code></p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>string</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Passes a user&#39;s consent to downstream providers via an IAB consent string. Does <em>not</em> pass Kevel consent, which must be passed via the <code>gdpr</code> parameter OR when an allowed <code>gdprVendorId</code> is passed and the user specifies ad selection consent (purpose number <code>3</code>) in the consent string.  </p>
<p><code>gdprConsentString</code> will be passed to downstream providers regardless of whether the request&#39;s IP address originates from the EU.</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>&quot;ALONGSTRINGGOESHERE&quot;</p>
</td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p><code>gdprConsentRequired</code></p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>boolean</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Requests with <code>gdprConsentRequired</code> set to <code>true</code> treat the user as requiring GDPR consent, even if the request or UserDB record doesn&#39;t use an EU IP address. Likewise, setting to <code>false</code> identifies the user as being outside of the EU and not subject to GDPR.</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p><code>true</code></p>
</td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p><code>gdprVendorId</code></p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>integer</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>A vendor ID that is used to compute the boolean <code>gdpr</code> consent from a consent string in <code>gdprConsentString</code><br>(if one is provided). The vendor ID is from <a href="https://vendorlist.consensu.org/vendorlist.json">the IAB vendor<br>list</a>. Consent will only be calculated if the vendor ID is allowed and the user specifies ad selection consent (purpose number <code>3</code>) in the consent string.</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p><code>1234</code></p>
</td>
</tr>
</tbody>
</table>
`}</HTMLBlock>

<Callout icon="📘" theme="info">
  You can also set an IAB consent string via RTB advertiser settings.

  Note that consent strings passed in via the request will take precedence over consent strings passed via RTB advertiser settings.
</Callout>

The requests below are examples of the additional consent strings being used to set regulations and derive GDPR consent:

`gdprConsentRequired` is `true`, which indicates that the user is subject to GDPR regulation and therefore consent defaults to `false`. However, the request passes the user's `gdprConsentString` and the applicable `gdprVendorId`, and the consent string contains ad serving consent for that allowed vendor ID. Kevel will calculate GDPR consent to `true`.

```json
{
  "consent": {
    "gdprConsentRequired": true,
    "gdprConsentString": "EXAMPLESTRING",
    "gdprVendorId": 1234
  },
  "placements": [
    {
      "divName": "div1",
      "networkId": 1234,
      "adId": 12345,
      "siteId": 12345,
      "adTypes": [
        5
      ]
    }
  ]
}
```

## Consent Setting Hierarchy

Kevel calculates a user's GDPR consent based on the method that sets consent, where certain ways of passing consent will take precedence over others. In the table below, a higher ranked method will override any consent settings beneath it.

| Rank | Method                                                                                               | Notes                                                                                                                                                                                                                                                                                                   |
| :--- | :--------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 1    | `"consent":{"gdprConsentRequired":true}` or `"consent":{"gdprConsentRequired":false}` on the request | While `gdprConsentRequired` does not pass user consent itself, its settings will effect the user's consent status. For example, if `gdprConsentRequired` is set to `false`, a user that has not set consent will have effectively consented (since the request is considered out of GDPR jurisdiction). |
| 2    | `"consent":{"gdpr": true}` or `"consent":{"gdpr": false}` on the request                             | Consent/non-consent that takes place at request time takes precedence over consent that has occurred earlier (such as in the IAB consent string or on the  UserDB record).                                                                                                                              |
| 3    | `"consent":{"gdprVendorId":1234, "gdprConsentString": "...."}` on the request                        | Note that the allowed vendor ID must be present in the consent string, and that user must have specified ad selection consent (purpose number `3`) in the consent string.                                                                                                                               |
| 4    | Consent via the user's UserDB record                                                                 |                                                                                                                                                                                                                                                                                                         |
| 5    | No consent passed                                                                                    | If the request is subject to GDPR regulation (via the IP address of the request or via `gdprConsentRequired` set to true), consent defaults to false. Otherwise, it defaults to true.                                                                                                                   |

## Right to Be Forgotten with UserDB

The [Forget User Endpoint](https://dev.kevel.com/reference/forget-user) goes further than the [User Opt-Out Endpoint](https://dev.kevel.com/reference/opt-out-a-user) by removing a UserDB record entirely and unsetting the `azk` cookie that contains the UserKey. It provides users tracked by Kevel customers with the right to be forgotten.

## Treating All Traffic as GDPR-Regulated

You can optionally treat all Kevel requests as GDPR-regulated regardless of the IP address from the request or user record. Users will then need to pass consent as if they were located in the EU.

Note that the All Traffic as GDPR-Regulated feature:

* Does not affect how the location of Kevel requests is processed in ad serving or reporting. Impressions, clicks etc. will still be recorded as originating from the country resolved from the IP address, and geotargeting will not be affected.
* Does not set or change GDPR consent. Consent still must be obtained via the request, user record, or consent string.

To enable this feature, you must first contact your Kevel account manager.