Segment
1. Segment Introduction
The server utilizes the key provided by the developer as a filter and passes it directly to the backend. If no grouping is specified, the default grouping strategy is applied.
1.1 TradPlus Reporting Data
The following data is reported by the 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 | For Android, fill in versionName; for iOS, fill in version. When including or excluding, multiple version numbers can be specified, separated by commas. |
| app | App installation time | int | range, >, < | 1 | Time elapsed since the first initialization of the TradPlus SDK. |
| app | SDK version | version | include, exclude, range, >, < | 1 | TradPlus SDK version. For include and exclude conditions, multiple version numbers can be specified, separated by commas. For > and < conditions, only one version number can be specified. |
| device | IDFA | string | include | 1 | When IDFA cannot be obtained on iOS 14, a traffic group can be created to classify these devices based on user authorization status. |
| device | Device ID | string | include | 1 | Multiple device IDs can be specified, separated by commas. The device ID can be IDFA, IDFV, GAID, or OAID. |
| device | System version | version | include, exclude, >, < | 1 | Mobile operating system version. For include and exclude conditions, multiple version numbers can be specified, separated by commas. For > and < conditions, only one version number can be specified. |
| device | Device type | string (ignore case) | include, exclude | 1 | Options include iPhone or iPad; multiple selections are allowed. |
| device | Device manufacturer | string (ignore case) | include, exclude | 1 | For example, "Huawei"; multiple selections are allowed. |
| device | Network connection type | string | include | 1 | Multiple selections are allowed; possible values are: WiFi, 2G, 3G, 4G, 5G. |
1.2 App Reporting Data
The following data can be selectively reported by developers as needed:
| Category | Key | Type | Condition | Number of Rules | Description |
|---|---|---|---|---|---|
| Custom | User ID | string | include | 1 | Multiple IDs can be specified, separated by commas. Additionally, TradPlus can provide device-level monetization data (API) based on this user ID. |
| Custom | Age | int | range, >, <, = | multiple | Enter a number (0-99) representing the user's age in years. |
| Custom | Gender | string | = | 1 | Web side allows single selection only; possible values: male, female. The SDK can pass values: unknown, male, female. |
| Custom | In-game level | int | range, >, <, = | 1 | User's level within the game. |
| Custom | In-app payment amount | float | range, >, <, = | 1 | Total amount spent by the user within the app. |
| Custom | In-app payment currency | string | = | 1 | Currently supports USD, CNY, EUR; single selection. |
| Custom | In-app payments | int | >, <, = | 1 | Number of in-app purchases made by the user. |
| Custom | Channel | string | include, exclude | 1 | Multiple channel numbers can be specified, separated by commas (maximum 50 characters). |
| Custom | Sub-channel | string | include, exclude | 1 | Multiple sub-channel numbers can be specified, separated by commas (maximum 20 characters). |
| Custom | Custom user attributes | string/int | Integer: range, >, <, =; String: include, exclude | Up to 5 | Custom user attributes passed by the application in the form of key-value pairs (key is 'custom_' + field name). Supports up to 5. |
| Custom | 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. |
2. Use of Traffic Grouping
2.1 App Global Custom Rule Settings
This interface should be called before initializing the SDK:
| Platform | Method |
|---|---|
| Android | SegmentUtils.initCustomMap(customMap); |
2.2 Placement Custom Rule Settings
| Platform | Method |
|---|---|
| Android | SegmentUtils.initPlacementCustomMap("placementId", customMap); |
2.3 Example
Below is an example for the Android SDK:
// Initialize global custom rules
Map<String, Object> customMap = new HashMap<>();
customMap.put("user_age", 25);
customMap.put("user_gender", "male");
SegmentUtils.initCustomMap(customMap);
// Initialize placement-specific custom rules
Map<String, Object> placementCustomMap = new HashMap<>();
placementCustomMap.put("user_level", 10);
SegmentUtils.initPlacementCustomMap("placementId", placementCustomMap);