Targeting Audiences
In order to take advantage of our targeting campaign, you must pass an instance of RequestOptions object in ad load call.
- Java
- Kotlin
Location myLocation = new Location("I");
myLocation.setLatitude(35.757866);
myLocation.setLongitude(10.810547);
RequestOptions requestOptions = new RequestOptions(
context = context,
age = 25,
consentFlag = CONSENT_FLAG,
location = location,
language = "en",
keyword = "brand=myBrand;category=sport",
contentUrl = "put your content url here",
gender = MNGGender.MNGGenderMale
)
bannerView.load(requestOptions);
interstitialAd.load(requestOptions);
rewardedAd.load(requestOptions);
// Native ad still use the old MNGPreference object but in future it will be changed to use RequestOptions
mngAdsNativeAdsFactory.loadNative(requestOptions.toMNGPreference());
val myLocation = Location("I")
myLocation.setLatitude(35.757866)
myLocation.setLongitude(10.810547)
val requestOptions = RequestOptions(
context = context,
age = 25,
consentFlag = CONSENT_FLAG,
location = location,
language = "en",
keyword = "brand=myBrand;category=sport",
contentUrl = "put your content url here",
gender = MNGGender.MNGGenderMale
)
bannerView.load(requestOptions)
interstitialAd.load(requestOptions)
rewardedAd.load(requestOptions)
// Native ad still use the old MNGPreference object but in future it be will changed to use RequestOptions
mngAdsNativeAdsFactory.loadNative(requestOptions.toMNGPreference())
Location Targeting
The Madvertise adserver and certain ad can use your user’s location to send more targeted ads by passing Latitude and Longitude.
- Java
- Kotlin
Location myLocation = new Location("I");
myLocation.setLatitude(35.757866);
myLocation.setLongitude(10.810547);
RequestOptions requestOptions = new RequestOptions(
...
consentFlag = CONSENT_FLAG,
location = location,
...
)
val myLocation = Location("I")
myLocation.setLatitude(35.757866)
myLocation.setLongitude(10.810547)
val requestOptions = RequestOptions(
...
consentFlag = CONSENT_FLAG,
location = location,
...
)
Note :
-
This device location can help you to get device location.
-
Do not serialize Location object (like transforming it into a string using gson library), this may lead to a fatal runtime error when that instance is reused.
-
The setLocation method takes the following parameters:
- the Location instance.
- the CONSENT_FLAG value (corresponds to a int : 0,1,2 or 3).
- 0 = Not allow to send location.
- 1 = When you managed location according to consent value.
- 2 and 3 = Allow the SDK to managed location directly in accordance with the consent value use TCF v1 or TCF v2, see with the madvertise team it depends on your implementation.
Keyword Targeting
Keywords allow you to target certain ad requests with user data. Keywords are useless for targeting, if you can provide dynamic values per users/devices.
To add keyword targeting, you will need to pass these keywords up through the application (They should be formatted as key/value pairs) :
- Characters per key: 20
- Characters per value: 40
- Java
- Kotlin
RequestOptions requestOptions = new RequestOptions(
...
keyword = "brand=myBrand;category=sport",
...
)
val requestOptions = RequestOptions(
...
keyword = "brand=myBrand;category=sport",
...
)
User Demographic Targeting
When people are signed in on your app, can you please share Demographic informations from their settings with following code :
- Java
- Kotlin
Location myLocation = new Location("I");
myLocation.setLatitude(35.757866);
myLocation.setLongitude(10.810547);
RequestOptions requestOptions = new RequestOptions(
...
age = 25,
gender = MNGGender.MNGGenderMale
...
)
val myLocation = Location("I")
myLocation.setLatitude(35.757866)
myLocation.setLongitude(10.810547)
val requestOptions = RequestOptions(
...
age = 25,
gender = MNGGender.MNGGenderMale
...
)
BlueStack Audience Targeting
Audiences can be defined by date of birth, gender, locations, Apple's Advertising Identifier (IDFA), Android's advertising ID or by a combination of rules used to identify users who took specific actions on your app (device, carrier, ...).
Content mapping for apps
(Since v2.4) https://support.google.com/adxseller/answer/6270563
- Java
- Kotlin
RequestOptions requestOptions = new RequestOptions(
...
contentUrl = "put your content url here",
...
)
val requestOptions = RequestOptions(
...
contentUrl = "put your content url here",
...
)