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 |
|
|
The user's age as a number (for example, |
|
|
The user's gender: |
|
|
The user's location as detected by your app. To use location data, obtain the user's consent and call |
|
|
The user's search query in the app. |
|
|
Keywords from the page the user was viewing. |
Was the article helpful?
Previous
Next