Data & Keyword Passing
Segment Targeting
AppLovin MAX SDK version 12.6.0 introduces a privacy-safe way to target waterfalls and Direct Sold campaigns. The APIs introduced in this version use a generic key-value numeric pairing method. You are responsible for mapping the segment and the applicable value(s) that represent the users you are targeting.
For example, you could establish a segment that represents the genres that a user is interested in.
Values for that segment might include horror, thriller, and romance.
You could represent this segment with the number 849
and give that segment the values of 1
, 2
, or 3
to represent those horror, thriller, and romance genres.
The following code shows how you would add a user to the horror and romance genre segments:
ALSdkInitializationConfiguration *initConfig = [ALSdkInitializationConfiguration configurationWithSdkKey: «SDK-key» builderBlock:^(ALSdkInitializationConfigurationBuilder *builder) { builder.mediationProvider = ALMediationProviderMAX; builder.segmentCollection = [MASegmentCollection segmentCollectionWithBuilderBlock:^(MASegmentCollectionBuilder *builder) { [builder addSegment: [[MASegment alloc] initWithKey: @(859) values: @[@(1), @(3)]]]; }];}];⋮[sdk initializeWithConfiguration: initConfig completionHandler:^(ALSdkConfiguration *sdkConfig) { …
let initConfig= ALSdkInitializationConfiguration(sdkKey: "«SDK-key»") { builder in builder.mediationProvider = ALMediationProviderMAX builder.segmentCollection = MASegmentCollection { segmentCollectionBuilder in segmentCollectionBuilder.add(MASegment(key: 849, values: [1, 3])) }}⋮sdk.initialize(with:initConfig) { sdkConfig in …
Content URL Passing
AppLovin recommends that you pass your app content URL when you make ad requests. It allows for buy-side contextualization or review. Some DSP buyers may require it. You pass this URL in the bid request.
The following code snippets show how you pass your app content URL when you make an ad request:
// Interstitial Adself.interstitialAd = [[MAInterstitialAd alloc] initWithAdUnitIdentifier: @"«ad-unit-ID»"];[self.interstitialAd setExtraParameterForKey: @"content_url" value: @"«value»"];
// Rewarded Adself.rewardedAd = [MARewardedAd sharedWithAdUnitIdentifier: @"«ad-unit-ID»"];[self.rewardedAd setExtraParameterForKey: @"content_url" value: @"«value»"];
// Banner Adself.bannerAd = [[MAAdView alloc] initWithAdUnitIdentifier: @"«ad-unit-ID»"];[self.bannerAd setExtraParameterForKey: @"content_url" value: @"«value»"];
// MREC Adself.mrecAd = [[MAAdView alloc] initWithAdUnitIdentifier: @"«ad-unit-ID»" adFormat: MAAdFormat.mrec ];[self.mrecAd setExtraParameterForKey: @"content_url" value: @"«value»"];
// Native Adself.nativeAdLoader = [[MANativeAdLoader alloc] initWithAdUnitIdentifier: @"«ad-unit-ID»"];[self.nativeAdLoader setExtraParameterForKey: @"content_url" value: @"«value»"];
// Interstitial Adlet interstitialAd = MAInterstitialAd(adUnitIdentifier: "«ad-unit-ID»")interstitialAd.setExtraParameterForKey("content_url", value: "«value»")
// Rewarded Adlet rewardedAd = MARewardedAd.shared(withAdUnitIdentifier: "«ad-unit-ID»")rewardedAd.setExtraParameterForKey("content_url", value: "«value»")
// Banner Adlet bannerAd = MAAdView(adUnitIdentifier: "«ad-unit-ID»")bannerAd.setExtraParameterForKey("content_url", value: "«value»")
// MREC Adlet mrecAd = MAAdView(adUnitIdentifier: "«ad-unit-ID»", adFormat: MAAdFormat.mrec)mrecAd.setExtraParameterForKey("content_url", value: "«value»")
// Native Adlet nativeAdLoader = MANativeAdLoader(adUnitIdentifier: "«ad-unit-ID»")nativeAdLoader.setExtraParameterForKey("content_url", value: "«value»")
Unified Identifiers
You can pass UID2 tokens in the bid stream. Buyers use these tokens to target and accurately bid on app inventory. You are responsible for tokenizing and for passing the token to AppLovin. The code examples below show how you pass the tokens:
// App Open Adself.appOpenAd = [[MAAppOpenAd alloc] initWithAdUnitIdentifier: @"«ad-unit-ID»"];[self.appOpenAd setExtraParameterForKey: @"uid2_token" value: @"«value»"]
// Banner Adself.bannerAd = [[MAAdView alloc] initWithAdUnitIdentifier: @"«ad-unit-ID»"];[self.bannerAd setExtraParameterForKey: @"uid2_token" value: @"«value»"];
// Interstitial Adself.interstitialAd = [[MAInterstitialAd alloc] initWithAdUnitIdentifier: @"«ad-unit-ID»"];[self.interstitialAd setExtraParameterForKey: @"uid2_token" value: @"«value»"];
// MREC Adself.mrecAd = [[MAAdView alloc] initWithAdUnitIdentifier: @"«ad-unit-ID»" adFormat: MAAdFormat.mrec ];[self.mrecAd setExtraParameterForKey: @"uid2_token" value: @"«value»"];
// Native Adself.nativeAdLoader = [[MANativeAdLoader alloc] initWithAdUnitIdentifier: @"«ad-unit-ID»"];[self.nativeAdLoader setExtraParameterForKey: @"uid2_token" value: @"«value»"];
// Rewarded Adself.rewardedAd = [MARewardedAd sharedWithAdUnitIdentifier: @"«ad-unit-ID»"];[self.rewardedAd setExtraParameterForKey: @"uid2_token" value: @"«value»"];
// App Open Adlet appOpenAd = MAAppOpenAd(adUnitIdentifier: "«ad-unit-ID»")appOpenAd.setExtraParameterForKey("uid2_token", value: "«value»")
// Banner Adlet bannerAd = MAAdView(adUnitIdentifier: "«ad-unit-ID»")bannerAd.setExtraParameterForKey("uid2_token", value: "«value»")
// Interstitial Adlet interstitialAd = MAInterstitialAd(adUnitIdentifier: "«ad-unit-ID»")interstitialAd.setExtraParameterForKey("uid2_token", value: "«value»")
// MREC Adlet mrecAd = MAAdView(adUnitIdentifier: "«ad-unit-ID»", adFormat: MAAdFormat.mrec)mrecAd.setExtraParameterForKey("uid2_token", value: "«value»")
// Native Adlet nativeAdLoader = MANativeAdLoader(adUnitIdentifier: "«ad-unit-ID»")nativeAdLoader.setExtraParameterForKey("uid2_token", value: "«value»")
// Rewarded Adlet rewardedAd = MARewardedAd.shared(withAdUnitIdentifier: "«ad-unit-ID»")rewardedAd.setExtraParameterForKey("uid2_token", value: "«value»")