Skip to content

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 decide the meaning of each key and each value.

For example, you could establish segments that represent the genres that a user is interested in. You could represent these segments with the key number 849.

Genre values might include “horror”, “thriller”, and “romance”. You could represent these by the the values of 1, 2, and 3 respectively.

The following code shows how you would add a user to the horror and romance genre segments, if you defined your keys and values in that way:

ALSdkInitializationConfiguration *initConfig = [ALSdkInitializationConfiguration configurationWithSdkKey: «SDK-key» builderBlock:^(ALSdkInitializationConfigurationBuilder *builder) {
builder.mediationProvider = ALMediationProviderMAX;
builder.segmentCollection = [MASegmentCollection segmentCollectionWithBuilderBlock:^(MASegmentCollectionBuilder *builder) {
[builder addSegment: [[MASegment alloc] initWithKey: @(849) values: @[@(1), @(3)]]];
}];
}];
[sdk initializeWithConfiguration: initConfig completionHandler:^(ALSdkConfiguration *sdkConfig) { …

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:

self.bannerAd = [[MAAdView alloc] initWithAdUnitIdentifier: @"«ad-unit-ID»"];
[self.bannerAd setExtraParameterForKey: @"content_url" value: @"«value»"];
Interstitial Ad
self.interstitialAd = [[MAInterstitialAd alloc] initWithAdUnitIdentifier: @"«ad-unit-ID»"];
[self.interstitialAd setExtraParameterForKey: @"content_url" value: @"«value»"];
MREC Ad
self.mrecAd = [[MAAdView alloc] initWithAdUnitIdentifier: @"«ad-unit-ID»" adFormat: MAAdFormat.mrec ];
[self.mrecAd setExtraParameterForKey: @"content_url" value: @"«value»"];
Native Ad
self.nativeAdLoader = [[MANativeAdLoader alloc] initWithAdUnitIdentifier: @"«ad-unit-ID»"];
[self.nativeAdLoader setExtraParameterForKey: @"content_url" value: @"«value»"];
Rewarded Ad
self.rewardedAd = [MARewardedAd sharedWithAdUnitIdentifier: @"«ad-unit-ID»"];
[self.rewardedAd 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:

ALSdkSettings *settings = [ALSdk shared].settings;
[settings setExtraParameterForKey: @"uid2_token" value: @"«value»"];

Custom Targeting For Google Ad Manager Direct Sold

You can pass custom targeting values to Google Ad Manager’s Direct Sold request.

To pass custom targeting values to Google Ad Manager, set the value (or values) of the local extra parameter custom_targeting to your targeting value (or values), as shown in the following examples:

Use the following object to declare your custom targeting value:

NSDictionary<NSString *, NSString *> customTargetingValues = @{@"«custom-targeting-key»" : @"«custom-targeting-value»"};
self.bannerAd = [[MAAdView alloc] initWithAdUnitIdentifier: @"«your-ad-unit-ID»"];
[self.bannerAd setLocalExtraParameterForKey: @"custom_targeting" value: customTargetingValues];
Interstitial Ad
self.interstitialAd = [[MAInterstitialAd alloc] initWithAdUnitIdentifier: @"«your-ad-unit-ID»"];
[self.interstitialAd setLocalExtraParameterForKey: @"custom_targeting" value: customTargetingValues];
MREC Ad
self.mrecAd = [[MAAdView alloc] initWithAdUnitIdentifier: @"«your-ad-unit-ID»" adFormat: MAAdFormat.mrec];
[self.mrecAd setLocalExtraParameterForKey: @"custom_targeting" value: customTargetingValues];
Rewarded Ad
self.rewardedAd = [MARewardedAd sharedWithAdUnitIdentifier: @"«your-ad-unit-ID»"];
[self.rewardedAd setLocalExtraParameterForKey: @"custom_targeting" value: customTargetingValues];