Ad targeting
You can use the Yandex Mobile Ads SDK API to add extra user information. Adding context data to the request can significantly enhance the quality of advertising and increase your revenue.
Set up targeting
You can pass user information in the ad request:
- For a banner (inline and sticky), use the
AdRequest
class. - For an interstitial ad, rewarded ad, or App Open Ad, use
AdRequestConfiguration
.
You can provide the following user information:
Parameter |
Description |
|
User age: a number in string format (for example, "14", "18", and so on) |
|
User's search query in the app. For instance, if the user searched for a car, the parameter might look like "Buy a used car in Moscow" |
|
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 include phrases such as "Buy a car", "used car", or "in Moscow" |
|
User gender: specified as one of the values in the Gender enumeration. Acceptable values: Gender.Male, Gender.Female. |
|
User location represented by an instance of the Location class, which contains latitude and longitude values. For example: new Location(55.734202, 37.588063). |
Examples of targeting
Adaptive inline and sticky banners
let adRequest = new AdRequest({
age: '20',
contextQuery: 'context-query',
contextTags: ['context-tag'],
gender: Gender.Male,
location: new Location(55.734202, 37.588063)
});
Interstitial ads, rewarded ads, and App Open Ads
let adRequestConfiguration = new AdRequestConfiguration({
adUnitId: 'your_block_id',
age: '20',
contextQuery: 'context-query',
contextTags: ['context-tag'],
gender: Gender.Female,
location: new Location(55.734202, 37.588063)
});