---
description: Pass user targeting information to ad requests
---

# User Targeting

### General Information

Some networks support adding additional information to improve the ads for the current app context. In addition to [key-value targeting](key-value-targeting), AATKit supports [user targeting](https://android-sdk.aatkit.com/references/-a-a-t-kit/com.intentsoftware.addapptr/-a-a-t-kit-user-targeting/index.html), allowing to pass information like:

* User ID
* Gender
* Year of birth&#x20;
* List of keywords

{% hint style="info" %}
Setting the user  targeting must be done after initializing AATKit.
{% endhint %}

### Usage

{% tabs %}
{% tab title="Java" %}
```java
AATKitUserTargeting aatKitUserTargeting = new AATKitUserTargeting();
aatKitUserTargeting.setUserID("USER_ID");
aatKitUserTargeting.setGender(AATKitGender.MALE);
aatKitUserTargeting.setYearOfBirth(1990);
aatKitUserTargeting.setKeywords(Arrays.asList("keyword1", "keyword2"));
AATKit.setUserTargeting(aatKitUserTargeting);
```
{% endtab %}

{% tab title="Kotlin" %}
```kotlin
val userTargeting = AATKitUserTargeting(userID = "<USER_ID>", gender = AATKitGender.MALE, yearOfBirth = 1990, keywords = listOf("keyword1", "keyword2"))
AATKit.setUserTargeting(userTargeting
```
{% endtab %}
{% endtabs %}

* Year of birth must be 4-digit number
* Each field in AATKitUserTargeting is optional

{% hint style="info" %}
Never provide IDs that allow identifying a real person such as names, email addresses and so on. Always use hashed data in such cases.
{% endhint %}
