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
To send targeting parameters, use the AdTargeting class. Pass the AdTargeting object to the AdRequest builder for all ad formats.
You can provide the following user information:
|
Parameter |
Description |
|
|
The user's age in string format, for example: |
|
|
User's gender: accepts values from the Use the |
|
|
The user's location as detected by your app, passed using the Before setting this parameter, obtain the user's consent and pass the permission to use the location to the SDK via the |
|
|
The user's search query in the app. For instance, if the user searched for a car, this parameter might look like this: |
|
|
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: |
Examples of targeting
AdTargeting targeting = new AdTargeting(
age: "20",
gender: Gender.FEMALE,
location: new Location.Builder()
.SetLatitude(55.734202)
.SetLongitude(37.588063)
.SetHorizontalAccuracy(100)
.Build(),
contextQuery: "context-query",
contextTags: new List<string> { "context-tag" });
AdRequest adRequest = new AdRequest(
"your_block_id",
targeting: targeting
);