---
description: Introduction to consent handling
---

# General Handling

### Get Consent (GDPR et al.)

Apps (more precisely: their publishers and third-party library vendors) have to get consent from the users for serving personalized ads in order to comply with data protection laws such as GDPR. Applications also have to provide a button for the user to be able to change the consent settings. AATKit provides three ways of handling user consent:

**Managed Consent**

If you plan to use an [IAB TCF](https://iabeurope.eu/transparency-consent-framework/) compliant [Consent Management Platform](https://iabeurope.eu/tcf-for-cmps/) (CMP) that Gravite has already adapted, and you don’t want to care about their specific APIs, you should consider using the [Managed Consent](managed-consent). The Managed Consent will also take care of automatically passing user consent to non IAB compliant ad networks that you use with AATKit. Also, it supports automatic detection of non GDPR locations and related handling of the CMP. Currently, the following CMPs are adapted:

* [Google](managed-consent/google-cmp)&#x20;
* [Sourcepoint](managed-consent/sourcepoint-cmp)&#x20;
* [SFBX (AppConsent)](managed-consent/sfbx-appconsent-cmp)

**Default Consent**

If you are using your own consent management platform (CMP) that is not implemented by Gravite, you can simply omit passing any consent data to us. AATKit will automatically handle the TCF or CCPA consent strings, if available, from SharedPreferences. Additionally, AATKit will read and respond to the non-IAB vendor consent string as part of its default behavior, as long as your CMP works with [Google's Additional Consent](https://support.google.com/admanager/answer/9681920?hl=en) specification (stores special string under `IABTCF_AddtlConsent`).

**Vendor Consent**

If you plan to use an [IAB TCF](https://iabeurope.eu/transparency-consent-framework/) compliant [Consent Management Platform](https://iabeurope.eu/tcf-for-cmps/) (CMP) that Gravite has not yet adapted, or you want to create your own GDPR-compliant consent management and explicitly want to manage consents for different ad networks/vendors, you should consider using the [Vendor Consent](vendor-consent) - specifically to pass consent to ad networks not complying with the IAB TCF (if you want to use those).

**Simple Consent**

If you don’t plan to use an [IAB TCF](https://iabeurope.eu/transparency-consent-framework/) compliant [Consent Management Platform](https://iabeurope.eu/tcf-for-cmps/) (CMP), or you want to create your own GDPR-compliant consent management but don’t want to explicitly consent for different ad networks/vendors, you can consider using [Simple Consent](simple-consent). It will just manage one single consent value that is relevant for all respective ad networks/vendors.

For more general information about data protection topics, please consider visiting [Gravite Landing Page](https://bitbucket.org/addapptr/addapptrlandingpage/wiki/Home).

### Rule Skipping (Skipping of Certain Ad Networks if Consent Missing) <a href="#rule-skipping" id="rule-skipping"></a>

* Certain ad networks don't deliver ads if user consent wasn't granted. In order to speed up mediation, those networks can be skipped within the mediation.
* This feature is disabled by default.
* If enabled AATKit skips mediation rules for ad networks in case the user didn't grant consent for them.
* Purpose: enable faster ad loading by skipping networks without consent which typically do not serve ads at all or very poorly paid ones.
* To enable rule skipping:

{% tabs %}
{% tab title="Java" %}
```java
AATKitConfiguration configuration = new AATKitConfiguration(this);
...
configuration.setShouldSkipRules(true);
...
AATKit.init(configuration);
```
{% endtab %}

{% tab title="Kotlin" %}
```kotlin
val configuration = AATKitConfiguration(this)
...
configuration.isShouldSkipRules = true
...
AATKit.init(configuration)
```
{% endtab %}
{% endtabs %}

#### Default list of networks to be skipped <a href="#markdown-header-default-list-of-networks-to-be-skipped" id="markdown-header-default-list-of-networks-to-be-skipped"></a>

By default, the following ad networks will be skipped when they have no consent and rule skipping is enabled:

* Digital Turbine (ADCOLONY)
* Admob
* AdX
* Amazon HB
* Xandr (APPNEXUS)
* Google AdManager (DFP)
* Google AdManager (Direct) (DFPDIRECT)
* Inmobi
* Ogury
* Verve (PUBNATIVE)
* Teads
* Equativ (SMARTAD)
* Equativ (Direct) (SMARTADSERVERDIRECT)
* YOC
* FeedAd
* Tappx
* Mintegral

#### Modifying list of networks to be skipped <a href="#markdown-header-modifying-list-of-networks-to-be-skipped" id="markdown-header-modifying-list-of-networks-to-be-skipped"></a>

If rule skipping is enabled, by default AATKit will use the above default set of networks to be skipped if they have no consent. To change this default set and skip rules only for specific ad networks:

{% tabs %}
{% tab title="Java" %}
```java
AATKitConfiguration configuration = new AATKitConfiguration(this);
configuration.setShouldSkipRules(true);
Consent consent = new SimpleConsent(NonIABConsent.OBTAINED);
// Skip rules only for SmartAd and Smaato
Set<AdNetwork> networksToBeSkipped = new HashSet<>();
networksToBeSkipped.add(AdNetwork.SMARTAD);
networksToBeSkipped.add(AdNetwork.SMAATO);
consent.setNoConsentNetworkStopSet(networksToBeSkipped);
configuration.setConsent(consent);
AATKit.init(configuration);
```
{% endtab %}

{% tab title="Kotlin" %}
```kotlin
val configuration = AATKitConfiguration(this)
configuration.isShouldSkipRules = true
val consent: Consent = SimpleConsent(NonIABConsent.OBTAINED)
// Skip rules only for SmartAd and Smaato
consent.setNoConsentNetworkStopSet(setOf(AdNetwork.SMARTAD, AdNetwork.SMAATO))
configuration.consent = consent
AATKit.init(configuration)
```
{% endtab %}
{% endtabs %}

### Retrieve Consent Opt-In Status

To check if consent is OptIn or not, use the following API:

{% tabs %}
{% tab title="Java" %}
```java
boolean isConsentOptIn = AATKit.isConsentOptIn();
```
{% endtab %}

{% tab title="Kotlin" %}
```kotlin
val isConsentOptIn = AATKit.isConsentOptIn()
```
{% endtab %}
{% endtabs %}

{% hint style="info" %}
This API only returns meaningful information after AATKit was successfully initialized (and did download its mediation rules from the backend (If you want to observe this, see [AATKit.Delegate](broken-reference))).
{% endhint %}

### CCPA Handling

AATKit now supports CCPA only if the CCPA consent string is found. AATKit will read and react automatically to the CCPA string changes in SharedPreferences.

{% hint style="info" %}
If both TCF and CCPA are present the TCF takes precedence.
{% endhint %}
