For better ad targeting, you can optionally specify the user's gender and age. If your app uses its own localization model, you can also specify the chosen locale in ISO 639-1 format (e.g. "ru", "en", "fr", etc.).
To set data, you need to use the customParams property of the created API instance.
Android
private NativeAd ad;private void initAd(){ // Create an instance of NativeAd ad = new NativeAd(YOUR_SLOT_ID, this); // Get an instance of CustomParams CustomParams customParams = ad.getCustomParams(); // Set the age customParams.setAge(25); // Set the gender customParams.setGender(CustomParams.Gender.MALE);}
iOS
@interface YourViewController : UIViewController@end@implementation YourViewController{ MTRGNativeAd *_ad;}- (void)initAd{ // Create an instance of MTRGNativePromoAd _ad = [MTRGNativeAd nativeAdWithSlotId:YOUR_SLOT_ID]; // Set the age _ad.customParams.age = [NSNumber numberWithInt:25]; // Set the gender _ad.customParams.gender = MTRGGenderMale;}
Unity
private InterstitialAd _interstitialAd;private void Awake(){ // Create an instance of MyTargetView _interstitialAd = new InterstitialAd(YOUR_SLOT_ID); // Set the age _interstitialAd.CustomParams.Age = 23; // Set the gender _interstitialAd.CustomParams.Gender = CustomParams.GenderEnum.Male;}