Skip to main content

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:

CategoryKeyTypeConditionNumber of RulesDescription
appApp versionversioninclude, exclude1For Android, fill in versionName; for iOS, fill in version. When including or excluding, multiple version numbers can be specified, separated by commas.
appApp installation timeintrange, >, <1Time elapsed since the first initialization of the TradPlus SDK.
appSDK versionversioninclude, exclude, range, >, <1TradPlus 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.
deviceIDFAstringinclude1When IDFA cannot be obtained on iOS 14, a traffic group can be created to classify these devices based on user authorization status.
deviceDevice IDstringinclude1Multiple device IDs can be specified, separated by commas. The device ID can be IDFA, IDFV, GAID, or OAID.
deviceSystem versionversioninclude, exclude, >, <1Mobile 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.
deviceDevice typestring (ignore case)include, exclude1Options include iPhone or iPad; multiple selections are allowed.
deviceDevice manufacturerstring (ignore case)include, exclude1For example, "Huawei"; multiple selections are allowed.
deviceNetwork connection typestringinclude1Multiple 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:

CategoryKeyTypeConditionNumber of RulesDescription
CustomUser IDstringinclude1Multiple IDs can be specified, separated by commas. Additionally, TradPlus can provide device-level monetization data (API) based on this user ID.
CustomAgeintrange, >, <, =multipleEnter a number (0-99) representing the user's age in years.
CustomGenderstring=1Web side allows single selection only; possible values: male, female. The SDK can pass values: unknown, male, female.
CustomIn-game levelintrange, >, <, =1User's level within the game.
CustomIn-app payment amountfloatrange, >, <, =1Total amount spent by the user within the app.
CustomIn-app payment currencystring=1Currently supports USD, CNY, EUR; single selection.
CustomIn-app paymentsint>, <, =1Number of in-app purchases made by the user.
CustomChannelstringinclude, exclude1Multiple channel numbers can be specified, separated by commas (maximum 50 characters).
CustomSub-channelstringinclude, exclude1Multiple sub-channel numbers can be specified, separated by commas (maximum 20 characters).
CustomCustom user attributesstring/intInteger: range, >, <, =; String: include, excludeUp to 5Custom user attributes passed by the application in the form of key-value pairs (key is 'custom_' + field name). Supports up to 5.
CustomSegment tagstringinclude1If 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:

PlatformMethod
AndroidSegmentUtils.initCustomMap(customMap);

2.2 Placement Custom Rule Settings

PlatformMethod
AndroidSegmentUtils.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);