Ad targeting

Targeting is used to set precise parameters so that users can see ads that are more relevant to them. Below is an example aligned with the current Yandex Mobile Ads SDK API.

For all ad formats, use AdRequest with optional AdTargeting.

Targeting example (Dart)

var adRequest = AdRequest(
  adUnitId: 'your_block_id',
  targeting: AdTargeting(
    age: 20,
    contextQuery: 'context-query',
    contextTags: ['context-tag'],
    gender: 'female',
    location: const AdLocation(latitude: 55.734202, longitude: 37.588063, accuracy: 0.1),
  ),
);

Pass adRequest to loadAd (or the banner constructor) as shown in the format guides.

Parameter

Description

age

The user's age as a number (for example, 14, 18).

gender

The user's gender: male or female.

location

The user's location as detected by your app.

To use location data, obtain the user's consent and call YandexAds.setLocationTracking(true) in the SDK.

contextQuery

The user's search query in the app.

contextTags

Keywords from the page the user was viewing.