Segement
一、Segment Introduction
The server will use the key passed by the developer as a filter and pass it directly to the backend; If there is no grouping, the default grouping strategy will be used.
1、TradPlus reporting data
The following data is reported by TradPlus SDK and developers do not need to process it.
category | Key | type | condition | Number of rules | description |
---|---|---|---|---|---|
app | App version | version | include, exclude | 1 | Fill in versionName for Android and version for ios. When including and excluding, you can fill in multiple version numbers, separated by commas. |
app | App installation time | int | Range, >, < | 1 | Counting from the first initialization of TradPlus SDK |
app | SDK version | version | Include, exclude, range, >, < | 1 | TradPlus SDK version, including and excluding, you can fill in multiple version numbers, separated by commas. When > and <, only one can be filled in. |
device | IDFA | string | include | 1 | When iOS14 cannot be obtained, we can create a traffic group to classify these devices based on whether the user authorizes IDFA. |
device | Device ID | string | include | 1 | You can fill in multiple device IDs on the web side, separated by English commas. The device ID can be IDFA, IDFV, GAID, OAID |
device | system version | version | Include, exclude, >, < | 1 | Mobile phone system version, including and excluding, you can fill in multiple system version numbers, separated by commas. When > and <, only one can be filled in |
device | Equipment Types | string(ignoreCase) | include, exclude | 1 | You can choose iPhone or iPad, multiple choices are allowed |
device | Equipment Manufacturing | string(ignoreCase) | include, exclude | 1 | Take Huawei as an example, you can select multiple |
device | Network connection type | string | include | 1 | Multiple selections are available on the web side, and the possible values are: WiFi, 2G, 3G, 4G, 5G |
2、App reporting data
The following data is selectively reported by developers as needed.
category | Key | type | condition | Number of rules | description |
---|---|---|---|---|---|
Custom user ID | user_id | string | include | 1 | You can enter multiple IDs on the web side, separated by commas. In addition, TradPlus can provide device-level monetization data (API) based on this user id. |
age | user_age | int | Range, >, <, = | multiple | Enter a number (0-99) in years |
gender | user_gender | string | = | 1 | The web side can only single-select, the possible values are: male, female; the sdk side can pass values: unknown, male, female |
In-game level | user_level | int | Range, >, <, = | 1 | |
In-app payment amount | user_iap_amount | float | Range, >, <, = | 1 | |
In-app payment currency | user_iap_currency | string | = | 1 | Currently supports USD, CNY, EUR. Single choice |
In-app payments | user_iap_count | int | >、<, = | 1 | |
channel | channel | string | include, exclude | 1 | The web side supports filling in multiple channel numbers, separated by commas. |
Sub-channel | sub_channel | string | include, exclude | 1 | The web side supports filling in multiple sub-channel numbers, separated by commas. |
Custom user attributes | custom_xxx | string/int | Integer: range, >, <, =; string: included, excluded | The application passes in custom user attributes, such as custom_username, in the form of Key-Value (key is 'custom_' + field name). Supports up to 5. | |
segment tag | segment_tag | string | include | 1 | If the SDK reports segment_tag, the waterfall configuration of the specified segment will be used. When this parameter matches, other parameters will be ignored. Supports at most 1. |
二、Use of traffic grouping
1、APP global custom rule settings
- The interface needs to be called before initializing the SDK
Platform | Methods |
---|---|
Android | SegmentUtils.initCustomMap(customMap); |
2、Placement custom rule settings
Platform | Methods |
---|---|
Android | SegmentUtils.initPlacementCustomMap("placementId", customMap); |
3、Example
- Android SDK code examples
HashMap<String, String> customMap = new HashMap<>();
customMap.put("user_gender", "male");//Male
customMap.put("user_level", "10");//Game level 10
SegmentUtils.initCustomMap(customMap);//Set the rules of APP dimensions, which are valid for all placements
SegmentUtils.initPlacementCustomMap("placementId", customMap);//Only valid for this advertising slot, it will override the rules set by the APP dimension
3、Custom user value grouping SDK settings
Note: TradPlus supports user value grouping, and allows developers to customize user value settings and return user eCPM matching value ranges through the existing traffic grouping function. key: uva_ecpm; value: custom value (stirng)
- iOS
self.rewardedVideoAd = [[TradPlusAdRewarded alloc] init];
self.rewardedVideoAd.dicCustomValue = @{@"uva_ecpm":@"7.1"};
[self.rewardedVideoAd setAdUnitID:_placementId];
//or v10.5.0+
NSMutableDictionary *customDictionary = [[NSMutableDictionary alloc] init];
customDictionary[@"uva_ecpm"] = @"7.1";
[TradPlus setCustomDictionary:customDictionary placementId:@"your placementId"];
- Android
HashMap<String, String> customMap = new HashMap<>();
customMap.put("uva_ecpm", "7.1");
SegmentUtils.initPlacementCustomMap("your placementId", customMap);
- Unity
Dictionary<string, string> customMap = new Dictionary<string, string>();
customMap.Add("uva_ecpm", "7.1");
extra.customMap = customMap;
TPRewardVideoExtra extra = new TPRewardVideoExtra();
extra.customMap = customMap;
TradplusRewardVideo.Instance().LoadRewardVideoAd("your placementId",extra);
- Flutter
Map customMap = {
"uva_ecpm": "7.1"
};
Map extraMap = TPRewardVideoManager.createRewardVideoExtraMap(customMap: customMap);
TPRewardVideoManager.loadRewardVideoAd("your placementId", extraMap: extraMap);