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:
val initConfig = AppLovinSdkInitializationConfiguration.builder( "«SDK-key»", this ) .setMediationProvider( AppLovinMediationProvider.MAX ) .setSegmentCollection( MaxSegmentCollection.builder() .addSegment( new MaxSegment( 849, Arrays.asList( 1, 3 ) ) ) .build() ) .build();⋮AppLovinSdk.getInstance( this ).initialize( initConfig, sdkConfig -> {⋮
val initConfig = AppLovinSdkInitializationConfiguration.builder("«SDK-key»", this) .setMediationProvider(AppLovinMediationProvider.MAX) .setSegmentCollection( MaxSegmentCollection.builder() .addSegment(MaxSegment(849, listOf(1, 3))) .build() ) .build()⋮AppLovinSdk.getInstance(this).initialize(initConfig) { 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.
You can pass your app content URL when you make an ad request. The following code snippets show how to do this:
// Interstitial AdinterstitialAd = new MaxInterstitialAd( "«ad-unit-ID»", this );interstitialAd.setExtraParameter( "content_url", "«value»" );
// Rewarded AdrewardedAd = MaxRewardedAd.getInstance( "«ad-unit-ID»", this );rewardedAd.setExtraParameter( "content_url", "«value»" );
// Banner AdbannerAd = new MaxAdView( "«ad-unit-ID»", this );bannerAd.setExtraParameter( "content_url", "«value»" );
// MREC AdmrecAd = new MaxAdView( "«ad-unit-ID»", MaxAdFormat.MREC, this );mrecAd.setExtraParameter( "content_url", "«value»" );
// Native AdnativeAdLoader = new MaxNativeAdLoader( "«ad-unit-ID»", this );nativeAdLoader.setExtraParameter( "content_url", "«value»" );
// Interstitial Advar interstitialAd = MaxInterstitialAd( "«ad-unit-ID»", this )interstitialAd.setExtraParameter( "content_url", "«value»" )
// Rewarded Advar rewardedAd = MaxRewardedAd.getInstance( "«ad-unit-ID»", this )rewardedAd.setExtraParameter( "content_url", "«value»" )
// Banner Advar bannerAd = MaxAdView( "«ad-unit-ID»", this )bannerAd.setExtraParameter( "content_url", "«value»" )
// MREC Advar mrecAd = MaxAdView( "«ad-unit-ID»", MaxAdFormat.MREC, this )mrecAd.setExtraParameter( "content_url", "«value»" )
// Native Advar nativeAdLoader = MaxNativeAdLoader( "«ad-unit-ID»", this )nativeAdLoader.setExtraParameter( "content_url", "«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 AdappOpenAd = new MaxAppOpenAd( "«ad-unit-ID»", this );appOpenAd.setExtraParameter( "uid2_token", "«value»" );
// Banner AdbannerAd = new MaxAdView( "«ad-unit-ID»", this );bannerAd.setExtraParameter( "uid2_token", "«value»" );
// Interstitial AdinterstitialAd = new MaxInterstitialAd( "«ad-unit-ID»", this );interstitialAd.setExtraParameter( "uid2_token", "«value»" );
// MREC AdmrecAd = new MaxAdView( "«ad-unit-ID»", MaxAdFormat.MREC, this );mrecAd.setExtraParameter( "uid2_token", "«value»" );
// Native AdnativeAdLoader = new MaxNativeAdLoader( "«ad-unit-ID»", this );nativeAdLoader.setExtraParameter( "uid2_token", "«value»" );
// Rewarded AdrewardedAd = MaxRewardedAd.getInstance( "«ad-unit-ID»", this );rewardedAd.setExtraParameter( "uid2_token", "«value»" );
// App Open Advar appOpenAd = MaxAppOpenAd( "«ad-unit-ID»", this )appOpenAd.setExtraParameter( "uid2_token", "«value»" )
// Banner Advar bannerAd = MaxAdView( "«ad-unit-ID»", this )bannerAd.setExtraParameter( "uid2_token", "«value»" )
// Interstitial Advar interstitialAd = MaxInterstitialAd( "«ad-unit-ID»", this )interstitialAd.setExtraParameter( "uid2_token", "«value»" )
// MREC Advar mrecAd = MaxAdView( "«ad-unit-ID»", MaxAdFormat.MREC, this )mrecAd.setExtraParameter( "uid2_token", "«value»" )
// Native Advar nativeAdLoader = MaxNativeAdLoader( "«ad-unit-ID»", this )nativeAdLoader.setExtraParameter( "uid2_token", "«value»" )
// Rewarded Advar rewardedAd = MaxRewardedAd.getInstance( "«ad-unit-ID»", this )rewardedAd.setExtraParameter( "uid2_token", "«value»" )