---
metadata:
  - name: generator
    content: Diplodoc Platform v5.57.3
alternate:
  - https://ads.yandex.com/helpcenter/en/easy/integration/android/advanced-settings/targeting.md
  - https://ads.yandex.com/helpcenter/ru/easy/integration/android/advanced-settings/targeting.md
  - https://ads.yandex.com/helpcenter/zh/easy/integration/android/advanced-settings/targeting.md
  - href: en/easy/integration/android/advanced-settings/targeting.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://ads.yandex.com/helpcenter/en/llms.txt

# Ad targeting

Targeting is used to set precise parameters so that users can see ads that are more relevant to them. Here's an example of using targeting:

#|
||

**Format**

|

**Entity**

||
||

* Sticky banners

* Inline banners

* Fixed banners

|

`AdRequest`

||
||

* Interstitial ads

* Rewarded ads

* App open ads

|

`AdRequest`

||
||

* Native ads

|

`AdRequest`

||
|#

```kotlin
val adRequest = AdRequest.Builder("demo-interstitial-yandex")
            .setAge("25")
            .setGender(Gender.MALE)
            .setLocation(Location("provider"))
            .setContextQuery("Buy a used car in Moscow")
            .setContextTags(listOf("Buy a car", "used car", "in Moscow"))
            .build()
loadAd(adRequest)
```

#|
||

**Parameter**

|

**Description**

||
||

`age`

|

The age of a user: a number in the string format (for example, "14", "18", and so on).

||
||

`gender`

|

The gender of a user: "male", "female".

You can use the `Gender` object to get a valid string.

||
||

`location`

|

The location of a user as detected by your app.

To use location data, you must obtain the user's consent to do so and then set `MobileAds.setLocationConsent(true)` in the SDK.

||
||

`contextQuery`

|

The user's search query in the app.

For instance, if a user searched for a car, this parameter might look like that: "Buy a used car in Moscow".

||
||

`contextTags`

|

The keywords from the page the user was viewing. These could 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 that: "buy a car", "used car", "in Moscow".

||
|#

