AppLovin MAX SDK version 12.6.0 introduces a privacy-safe way to target waterfalls. The APIs introduced in this version target a generic key-value numeric pairing. You are responsible for mapping the segment key and the applicable value(s) that represent the users you target.
For example, you could establish segments that represent the genres that interest a user.
You could represent these segments with the key number 849.
Genre values might include “horror”, “thriller”, and “romance”.
You could represent these by 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:
val initConfig = AppLovinSdkInitializationConfiguration.builder( "«SDK-key»" )
.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»")
.setMediationProvider(AppLovinMediationProvider.MAX)
.setSegmentCollection(MaxSegmentCollection.builder()
.addSegment(MaxSegment(849, listOf(1, 3)))
.build()
)
.build()
⋮
AppLovinSdk.getInstance(this).initialize(initConfig) { sdkConfig ->
⋮
}
MASegmentCollection *segmentCollection = [MASegmentCollection segmentCollectionWithBuilderBlock:^(MASegmentCollectionBuilder *builder) {
[builder addSegment:[[MASegment alloc] initWithKey:@(849) values:@[@(1), @(3)]]];
}];
ALSdkInitializationConfiguration *initConfig = [ALSdkInitializationConfiguration configurationWithSdkKey:@"«SDK-key»"
builderBlock:^(ALSdkInitializationConfigurationBuilder *builder) {
builder.mediationProvider = ALMediationProviderMAX;
builder.segmentCollection = segmentCollection;
}];
let segmentCollection = MASegmentCollection { builder in
builder.add(MASegment(key: 849, values: [1, 3]))
}
let initConfig = ALSdkInitializationConfiguration(sdkKey: "«SDK-key»") { builder in
builder.mediationProvider = ALMediationProviderMAX
builder.segmentCollection = segmentCollection
}
MaxSegmentCollection collection = MaxSegmentCollection.Builder()
.AddSegment(new MaxSegment(849, new List<int>() {1, 3}))
.Build();
MaxSdk.SetSegmentCollection(collection);
MaxSdk.InitializeSdk();
AppLovinMAX.addSegment( 849, [1, 3] );
AppLovinMAX.initialize( «SDK-key» ).then( ( conf: Configuration ) => {
})
AppLovinMAX.add_segment(849, [1, 3])
AppLovinMAX.initialize(«SDK-key», init_listener)
AppLovinMAX.addSegment( 849, [1, 3] );
MaxConfiguration? sdkConfiguration = await AppLovinMAX.initialize(«sdk-key»);
AppLovinMAX.addSegment(849, [1, 3]);
AppLovinMAX.initialize(«SDK-key», function (configuration) {
});
For an example of how you can use segment targeting, see SDK integration guides > Platform > Overview > Data and keyword passing.
You can either choose not to target by segment (Do Not Enable) or you can choose to target by segment (Enable) and then type in a subset of those numeric mappings that your app passes to MAX, as «segment»:«value» pairs that conform to the following rules:
- in front of the segment (for example, -849:2 targets those devices for which the segment 849 does not have the value 2).849 segment is 1, 2, or 3:
+849:1, +849:2, +849:3+849:1,+850:2
+849:1,+851:3
means [( §849≡1 ) ∨ ( §850≡2 )] ∧ [( §849≡1 ) ∨ ( §851≡3 )].0; the maximum is 32000.