# Customize the notice

The notice is the first banner or pop-in that gets displayed on your app to ask the user to give consent. It is a short version of the full Preferences pop-in that has all the details on the purposes and vendors that you are collecting consent for.

This section presents the main customization options that are available for the consent notice.

## Country and GDPR

If you are an EU-based company then you must collect consent and enforce GDPR for all users no matter where they are located. There is no exception to that rule so you'll want to keep the properties `app.gdprAppliesGlobally` and `app.gdprAppliesWhenUnknown` to `true`.

If you are not an EU company then your only obligation is to enforce GDPR for EU-based users. We offer the following two configuration options for you to define what behavior you want:

* `app.gdprAppliesGlobally` defines whether GDPR should be applied to all visitors or not. If set to `true`, all visitors will see consent notices. If set to `false`, only visitors from the EU will see the consent notices.
* `app.gdprAppliesWhenUnknown` defines what to do when the user country is unknown. If the SDK is unable to determine the user country (because the device does not have a location, the location permission is not available, or there is no Internet connection), this flag will decide if the user should see a consent notice or not. If set to `true`, the user will see a consent notice when its country is unknown.

Example:

{% code title="Custom JSON" %}

```javascript
{
    "app": {
        "gdprAppliesGlobally": true,
        "gdprAppliesWhenUnknown": true
    }
}
```

{% endcode %}

### Publisher country

You can define your publisher country code by setting `app.country` property in the configuration file (2 letters, ISO 3166-1 alpha-2). This value will be used when generating the IAB TCF consent, both in the consent string and stored on device with the `IABTCF_PublisherCC` key.

Example:

{% code title="Custom JSON" %}

```javascript
{
    "app": {
        "country": "ES"
    }
}
```

{% endcode %}

## Supported languages

Our SDK supports multiple languages out-of-the-box with translations for all our standard messages. See below if your website uses other languages.\
English is the default language: if a visitor does not use a supported language, the banner and popups will be displayed in English.

You do not need to do anything to use Didomi's languages. However, you can choose to enable only certain languages and set up a different default language.\
Set the `languages.enabled` property to your list of supported languages and `languages.default` property as the default language in case the customer language is not supported:

{% code title="Custom JSON" %}

```javascript
{
  "languages": {
    "enabled": ['en', 'fr'],
    "default": 'fr'
  }
}
```

{% endcode %}

By default, `enabled` is the list of supported languages by Didomi and `default` is `en`. You can support a different language by changing the English texts and setting English as the only enabled language.

We currently support the following languages: [#languages-supported](https://developers.didomi.io/api-and-platform/introduction/translations#languages-supported "mention")

## Position (Mobile only)

On mobile, the notice can be displayed as a popup or a regular bottom banner.

The `notice.position` configuration parameter lets you define the position of the notice. The possible values are:

| Values   | Description                                                                                                            |
| -------- | ---------------------------------------------------------------------------------------------------------------------- |
| `popup`  | Display the notice as a full-screen popup. Also set your website logo and name to make sure the popup is personalized. |
| `bottom` | Display a banner notice at the bottom of the screen                                                                    |

Examples:

{% tabs %}
{% tab title="Bottom banner" %}
{% code title="Custom JSON" %}

```javascript
{
  "notice": {
    "position": "bottom"
  }
}
```

{% endcode %}
{% endtab %}

{% tab title="Popup" %}
{% code title="Custom JSON" %}

```javascript
{
  "notice": {
    "position": "popup"
  }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Disagree & Close

You can enable the "Disagree & Close" option from the notice by setting the `denyOptions` property. In this case, the "Learn More" button will be shown as a link.

To show a button containing the "Disagree & Close" text, set the `denyOptions.button` property to `primary` or `secondary`. Default is `none`. Note that on TV, the Disagree & Close button will always be displayed with the same style, whether the property is set to `primary` or `secondary`.

#### Disagree & Close as primary

You can show the "Disagree & Close" button styled as a primary button by setting the `denyOptions.button` to `primary` as shown below:

{% code title="Custom JSON" %}

```json
{
    "notice": {
        "denyOptions": {
            "button": "primary"
        }
    }
}
```

{% endcode %}

Expected result:

![Disagree & Close button when deny button is set to primary (mobile)](https://1703900661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDh8ZWDZrXs8sc4QKEQ%2Fuploads%2Fgit-blob-e23a34317c9e844d3c8a9df4bd1df652f0b16e77%2FCapture%20d%E2%80%99%C3%A9cran%202022-01-18%20%C3%A0%2011.56.58.png?alt=media)

<figure><img src="https://1703900661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDh8ZWDZrXs8sc4QKEQ%2Fuploads%2Fgit-blob-e0133ffbf98c8b244ac111fb6bd8b4b762134ee2%2FScreenshot_1712305102.png?alt=media" alt=""><figcaption><p>Disagree &#x26; Close button when deny button is set to primary or secondary (TV)</p></figcaption></figure>

#### Disagree & Close as secondary

On mobile, you can show the "Disagree & Close" button styled as a secondary button by setting the `denyOptions.button` to `secondary` as shown below:

{% code title="Custom JSON" %}

```json
{
    "notice": {
        "denyOptions": {
            "button": "secondary"
        }
    }
}
```

{% endcode %}

Expected result:

![Disagree & Close button when deny button is set to secondary (mobile)](https://1703900661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDh8ZWDZrXs8sc4QKEQ%2Fuploads%2Fgit-blob-f9d6a22ae8261dbdd3c2813903f4febeb7a43107%2FCapture%20d%E2%80%99%C3%A9cran%202022-01-18%20%C3%A0%2011.57.19.png?alt=media)

#### Remove Disagree & Close button

To make sure the "Disagree & Close" button is not displayed, you can disable it by setting `denyOptions.button` to `none`, as shown below:

{% code title="Custom JSON" %}

```json
{
    "notice": {
        "denyOptions": {
            "button": "none"
        }
    }
}
```

{% endcode %}

### "Continue without agreeing" link (mobile)

On mobile, you can also display a "Continue without agreeing" link rather than the "Disagree & Close" button by setting the `denyOptions.link` property to `true` and `denyOptions.button` to `none`, as shown below:

{% code title="Custom JSON" %}

```json
{
    "notice": {
        "denyOptions": {
            "link": true,
            "button": "none"
        }
    }
}
```

{% endcode %}

Expected result:

!["Continue without agreeing" link when denyOptions.link is set to true.](https://1703900661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDh8ZWDZrXs8sc4QKEQ%2Fuploads%2Fgit-blob-c7b68e414da39f5baff75325fcccc0fae80759f0%2FCapture%20d%E2%80%99e%CC%81cran%202022-01-18%20a%CC%80%2011.56.19.png?alt=media)

The "Continue without agreeing" link has the same behavior as the "Disagree & Close" button.

### Close cross (mobile)

In order to comply with Italian regulations, you should display a cross allowing users to close the notice. On mobile, you can display a cross instead of the "Continue without agreeing" link by setting the `denyOptions.cross` property to `true` and `denyOptions.button` to `none`, as shown below:

{% code title="Custom JSON" %}

```json
{
    "notice": {
        "denyOptions": {
            "cross": true,
            "button": "none"
        }
    }
}
```

{% endcode %}

Expected result:

![Cross allowing to close the notice without agreeing](https://1703900661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDh8ZWDZrXs8sc4QKEQ%2Fuploads%2Fgit-blob-83eb710c264419cd0f463b46dde77be94ca34435%2FCapture%20d%E2%80%99%C3%A9cran%202022-01-18%20%C3%A0%2011.57.52.png?alt=media)

The cross has the same behavior as the "Disagree & Close" button.

### "Disagree" and legitimate interest

By default, "Disagree & close" and "Continue without agreeing" only apply to consent, not legitimate interest. This means that after this option was selected, purposes based on legitimate interest will still be enabled, and vendors using these purposes will still be enabled for data processing based on legitimate interest.

This behavior can be controlled by setting the `denyAppliesToLI` property. When set to `true`, selecting "Disagree & close" or "Continue without agreeing" will disable both consent and legitimate interest based data processing for all purposes and all vendors..json

{% code title="Custom JSON" %}

```json
{
    "notice": {
        "denyOptions": {
            "button": "primary"
        },
        "denyAppliesToLI": true
    }
}
```

{% endcode %}

## Texts

You can change the message of the notice as well as the "Agree & Close" and "Learn More" buttons.

| Configuration Key               | Description                    |
| ------------------------------- | ------------------------------ |
| `notice.content.title`          | Title of the banner or popup   |
| `notice.content.notice`         | Message in the banner or popup |
| `notice.content.dismiss`        | "Agree & Close" button         |
| `notice.content.deny`           | "Disagree & Close" button      |
| `notice.content.learnMore`      | "Learn More" button            |
| `notice.content.privacyPolicy*` | "Our Privacy Policy" button    |

*\* Fields marked with asterisk are relevant only for TV SDKs for now*

Example:

{% code title="didomi\_config.json" %}

```javascript
{
  "notice": {
    "content": {
      "notice": {
        "en": "This website uses cookies to provide you with tailored commercial offers",
        "fr": "Ce site utilise des cookies pour vous fournir des offres commerciales personalisées"
      },
      "dismiss": {
        "en": "Agree & Close",
        "fr": "Accepter et fermer"
      },
      "deny": {
        "en": "Disagree & Close",
        "fr": "Refuser et fermer"
      },
      "learnMore": {
        "en": "Learn More",
        "fr": "En savoir plus"
      },
      "privacyPolicy": {
        "en": "Our Privacy Policy",
        "fr": "Notre politique de confidentialité"
      },
      "viewOurPartners": {
        "en": "View our partners",
        "fr": "Voir nos partenaires"
      }
    }
  }
}
```

{% endcode %}

Note that you should provide translations for all the languages that your app supports. We provide translations for all our standard messages.

## Vendors and purposes

You must configure the vendors for which consent is collected by our consent notice and displayed in the preferences popup.

[Read our detailed section](https://gitlab.com/didomi/developers-documentation/-/blob/main/docs/cmp/mobile-sdk/consent-notice/broken-reference/README.md) to see how they can be configured.

## Window for recollecting consent

By default, consent is automatically re-collected and the notice is displayed in these cases:

* After 13 months (maximum acceptable cookie lifetime)
* When a new vendor is added in the IAB vendors list (if you choose the option `all`)

The third case (a new vendor is added) can happen pretty often so you have the option to choose a number of days during which the notice will not be displayed even though there are new vendors to collect consent for. By default, the number is zero and the notice will be displayed automatically if a new vendor is added.

During that consent recollection window:

* New users will be asked for consent for the new vendor immediately.
* Previous users that had already given consent within the window (ie less than X days ago) will not be asked again until the expiration of the window. The new vendor will not have consent during that time.
* Previous users that had already given consent outside of the window (ie more than X days ago) will be asked again immediately.

```javascript
{
    "notice": {
        "daysBeforeShowingAgain": 5 // Number of days. Default is 0
    }
 } 
```

{% hint style="info" %}
If you choose that option and because the notice is not shown again, the user consent status will be partial and some vendors will not have consent information. The function `Didomi.isUserConsentStatusPartial()` can return `true` in these cases.
{% endhint %}

## Recollect consent after a certain date

In some cases, you might want to force recollect consent for all users after a certain date, irrespective of their choices and the configured window for recollecting consent.

This can be achieved by setting an ISO8601 date in the `user.ignoreConsentBefore` property:

```javascript
{
    "user": {
       "ignoreConsentBefore": "2020-09-09T00:00:00Z"
    }
}
```

When the user has given consent before the provided date, consent will be automatically recollected. Dates in the future are ignored until they become current so you can schedule a consent recollection for a specific date in the future.

## Consent expiration

Didomi CMP allows you to customize the lifetime of the consent so that it expires after a specific time.

You can use `app.consentDuration` configuration option to specify custom consent duration:

```javascript
{
    "app": {
        "consentDuration": 2592000 // Custom consent duration in seconds
    }
}
```

The `app.consentDuration` configuration option accepts custom consent duration value in seconds.

By default, consent expires after 31,622,400 seconds (approximately 12 months) if custom consent duration is not specified.

## Denied consent duration

It is possible to apply a specific consent duration when user denies consent for all purposes and vendors. This is done by setting the `app.deniedConsentDuration` configuration option.

```javascript
{
    "app": {
        "deniedConsentDuration": 1296000 // Denied consent duration in seconds
    }
}
```

If this option is set and user disagrees to consent based data processing for all purposes and vendors (legitimate interest based data processing is ignored), the consent will expire after this time instead of the standard consent duration, and user consent will be asked again.

{% hint style="info" %}
If user selects "disagree to all" button from notice or from preferences screen, and `app.deniedConsentDuration` is set, this duration will apply.

`app.deniedConsentDuration` value should be shorter than `app.consentDuration`, otherwise it will be ignored.
{% endhint %}

The `app.deniedConsentDuration` configuration option accepts custom consent duration value in seconds.

If no value is set, the standard consent duration will still be applied to denied consents.
