---
metadata:
  - name: generator
    content: Diplodoc Platform v5.57.3
alternate:
  - https://boost.yandex.ru/doc/en/ad-monetization/dev/compose-multiplatform/target.md
  - https://boost.yandex.ru/doc/ru/ad-monetization/dev/compose-multiplatform/target.md
  - href: en/ad-monetization/dev/compose-multiplatform/target.md
    type: text/markdown
    title: Markdown version
  - href: llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://boost.yandex.ru/doc/en/llms.txt

<!--
Используется в Boost: boost/en/ad-monetization/dev/compose-multiplatform
-->

# Ad targeting

You can use the Yandex Mobile Ads SDK API to add extra details about users to ad requests. Contextual data can help boost ad relevance and maximize your revenue.

## Set up targeting {#setup}

To pass extra details about users, specify `AdTargeting` in `AdRequest`.

You can provide the following user information:

#|
|| **Parameter** | **Description** ||
|| `age` | The user's age in string format (for example, `"14"`, `"18"`, and so on). ||
|| `gender` | The gender of the user. Possible values: `male` or `female`. ||
|| `location` | The user's location as detected by your app, passed using the `AdLocation` class.

To use location data, obtain user consent and enable location tracking in the SDK by calling `YandexAds.setLocationTracking(true)`. ||
|| `contextQuery` | The user's search query in the app.

For instance, if the user searched for a car, this parameter might look like this: `"Buy a used car in Moscow"`. ||
|| `contextTags` | The keywords from the page the user was viewing. These can be the page's title, parts of its content, tags, and other elements.

For a page with a car search, this parameter might look like a list such as `"Buy a car"`, `"used car"`, `"in Moscow"`. ||
|#


## Examples of targeting {#examples}

```kotlin
val adRequest = AdRequest(
    adUnitId = "R-M-XXXXXX-Y",
    targeting = AdTargeting(
        age = "20",
        contextQuery = "context-query",
        contextTags = listOf("context-tag"),
        gender = "female",
        location = AdLocation(latitude = 55.734202, longitude = 37.588063, accuracy = 0.1),
    ),
)
```
