Menu

Segment

1. Introduction to segment

TopOn provides multiple dimensions to group users. Different segments can be configured with different Waterfalls to achieve refined traffic monetization. The segment dimensions currently supported by TopOn are as follows: Region, advertising style, application, advertising slot, date, week, hour, network type, Application version, SDK version, system version, device type, device ID, device brand, installation source, installation time and custom rules, etc.

2. Segment settings

(1 ) In the TopOn developer backend, the Aggregation Management page can create and manage segment

(2) The various setting rules for traffic grouping are as follows:

RulesConditionsNumber of rulesDescriptionExample
RegionIncludes, excludes1You can select multiple regionsMainland China, the United States
CityIncluded, excluded1You can select multiple cities. After selecting the region, you can choose the cityGuangzhou, Beijing
DateIncludeMultipleYou can select 2022-01-01 00:00 to 2022-01-26 23:59. Multiple selections are allowed2022-01-01 00:00 to 2022-01-26 23:59, 2022-02-01 00: 00 to 2022-02-26 23:59 Use OR conditions for judgment, that is, if one of the dates is met
Day of the weekincludes1 You can choose from Monday to Sunday. Multiple selections possibleMonday, Tuesday
HoursincludesMultipleYou can select weeks from 00:00 to 23:5910:00 to 23:59
Time zoneEqual1You can choose various time zones around the worldUTC+8 Beijing
Network typeIncludes< /td>12G\3G\ can be selected 4G\WiFi. Multiple selections availableWiFi
Application version nameIncludes and excludes1App Version Name (App Version Name), you can fill in multiple application versions, separated by English commas< /td>2.2.1,2.2.2
Application version numberIncludes, excludes, ≥, ≤1Application version number (App Version Code), which must be a positive integer. Including or not included, multiple application version numbers can be entered, separated by commas; ≥ or ≤, only one application version number can be entered11,12 or 11
SDK versionInclude, exclude, >, <1TopOn SDK version, including and excluding, you can fill in multiple SDK version numbers, separated by English commas. > and <, only one can be filled in5.0.0
System versionInclude, exclude, >, << /td>1Mobile system version, including and If not included, you can fill in multiple system version numbers, separated by commas. > and <, only one can be filled inIncluding 13.3.1; less than 10.0.0
Device IDincludes1Can fill in multiple device IDs, in English Comma separated, device ID can be IDFA, GAID, Android28968E75-E7BE-4AA2-BFA0-C455DD74C111
Device typeIncluded, excluded 1You can choose iPhone or iPad . Multiple selections availableiPad
Equipment brandIncluding and excluding1You can choose multiple brandsXiaomi
Installation time>,<MultipleThe installation time is calculated based on the time when TopOn SDK is first initialized. Multiple installation time rules are in a relationship and must meet the traffic grouping at the same time to take effect.
Hours/days/weeks: Calculate the time interval from the request time to the installation time in units of hours/days/weeks;
Natural days: Calculate the time interval from the request date to the installation date.
< 1 day
Installation sourceIncluded, excluded1The package name of the source channel (app store, browser) where this application is installed. For example, the installation source is Google Play can fill in the package name (com.android.vending). You can enter multiple installation sources, separated by commas
Note: Only valid for Android systems.
com.google.xxx
ChannelsIncluding and excluding1Supports filling in multiple channel numbers, separated by English commas. The channel numbers must first pass the SDK's < span style="color: rgb(44, 62, 80);">Custom rulesIncomingchannel_1
Sub-channelIncludes and excludes1Supports filling in multiple sub-channel numbers, separated by English commas. The sub-channel numbers must first pass the SDK's Custom rulesIncomingsub_channel_1
User IDIncludes, excludes, ≥, ≤, interval 1Developers can use numbers Number users, such as each user corresponding to a globally non-unique number). The user number must first be passed in through the SDK's Custom rules. Only supported by Android SDK v6.1.32 and above100001
Custom rulesEqual to use= symbol is not equivalent to using != symbol, and use & symbol1Set through Key-Value conditions. Key and Value conditions can be Equal to= or not equal to!=, one Key can correspond to multiple Values, separated by English commas. Use & between multiple conditions, that is, multiple conditions need to be met at the same time. It is recommended that Value use the following character rules: uppercase and lowercase letters, numbers and underscores [A-Za-z0-9_]For example, 18-year-old male Users, brought through Toutiao or Tencent promotion, are divided into a group, and the custom rules that need to be filled in are age=18&gender=male&channel=bytedance,tencent
Cold start requestEqual1TopOn SDK will automatically determine whether to apply cold start, and this traffic grouping configuration will be used during cold start. It is recommended to configure fewer advertising sources for cold start to reduce request time and improve display rate. TopOn SDK v6.1.78 and above are supportedView cold start request instructions
SDK preset strategyEqual1TopOn supports developers to export SDK preset strategies for advertising space dimensions, which can be preset to you before the application is released. in the App. When the app installation starts for the first time, TopOn will use the SDK preset strategy to request ads to increase the ad display rate when the app installation starts for the first time. Supported by TopOn SDK v6.1.78 and aboveSDK preset policy rules cannot be used together with other rules in traffic grouping, View SDK preset strategy usage instructions

Set multiple When there are two rules, each rule is judged using AND conditions. That is, the traffic group will be issued only when all conditions are met at the same time

3.TopOn SDK sets custom rules for traffic grouping

3.1 Custom rule setting method

It is recommended to call the interface of TopOn SDK before initializing TopOn SDK and pass in custom rules Parameters

1.App global custom rule settings

2. Custom rule settings for Placement

TopOn Android SDK V5.5.2 and above is supported and is only valid for the current Placement . You can add Placement-specific custom rules based on App custom rules

Android methodiOS methodUnity method
initPlacementCustomMapsetCustomData:forPlacementIDsetCustomDataForPlacementID

3. Sample code

The following code example is for users who are male and age=18, and brought through Toutiao promotion

  • Android

Map<String, String> customMap = new HashMap<>();
customMap.put("age","18");  //age=18
customMap.put("gender","male"); //gender=male
customMap.put("channel","bytedance"); // promotion network is byte dance
ATSDK.initCustomMap(customMap); // The custom rules of the App are set globally and are valid for all placements.
// This rule is only valid for the current Placement and you can add custom rules specific to this Placement on top of the custom rules defined in the App.
ATSDK.initPlacementCustomMap(placementId, customMap); 
  • iOS
// age=18,gender=male and promotion network is byte dance, 
// The custom rules of the App are set globally and are valid for all placements.
[ATAPI sharedInstance].customData = @{kATCustomDataUserIDKey:@"test_custom_user_id",
    kATCustomDataChannelKey:@"custom_data_channel",
    kATCustomDataSubchannelKey:@"custom_data_subchannel",
    kATCustomDataAgeKey:@18,
    kATCustomDataGenderKey:@"male",
    kATCustomDataNumberOfIAPKey:@19,
    kATCustomDataIAPAmountKey:@20.0f,
    kATCustomDataIAPCurrencyKey:@"usd",
}; 

// This rule is only valid for the current Placement and you can add custom rules specific to this Placement on top of the custom rules defined in the App.
[[ATAPI sharedInstance] setCustomData:@{
    kATCustomDataChannelKey:@"placement_custom_data_channel",
    kATCustomDataSubchannelKey:@"placement_custom_data_subchannel"
} forPlacementID:@"your placementID"];
  • Unity
// The custom rules of the App are set globally and are valid for all placements.(optional)
ATSDKAPI.initCustomMap(new Dictionary<string, string> { { "unity3d_data", "test_data" } }); 

// This rule is only valid for the current Placement and you can add custom rules specific to this Placement on top of the custom rules defined in the App.(optional)
ATSDKAPI.setCustomDataForPlacementID(new Dictionary<string, string> { { "unity3d_data_pl", "test_data_pl" } } ,placementId);

Backend configuration example:

3.2 Predefined Key of custom rules

TopOn SDK predefines the following keys in App global custom rules value (new in v5.5.5). If the following keys cannot meet the needs, you can add the key yourself. You only need to match the corresponding key when adding a custom traffic group.

KeyDescription
user_idUser ID. It is defined by the developer and passed into the TopOn SDK. Subsequently, TopOn supports statistical data based on the user ID dimension
channelChannel. The following character rules are recommended: uppercase and lowercase alphanumeric and underscore [A-Za-z0-9_]
sub_channelSub channel. The following character rules are recommended: uppercase and lowercase alphanumeric and underscore [A-Za-z0-9_]
user_numberUser number. Developers can use numbers to number users. For example, each user corresponds to a globally non-unique number
Only supported by Android SDK v6.1.32 and above
ageAge
genderGender, such as male, female, unknown
iap_amountIn-app Payment amount
iap_currencyIn-app payment currency, such as US dollar "USD"
iap_timeIn-app pay time

4.TopOn advertising space uses traffic grouping

(1) You can configure multiple traffic groupings for a single TopOn ad slot in Aggregation Management

  • When configuring multiple traffic groups, each traffic group will have Priority, the prefix number of the traffic group is the priority, 1 is the highest priority, and the priority decreases from left to right. When multiple traffic groups are hit at the same time, TopOn will return the highest priority traffic group ad source configuration
  • You can View the traffic group ID

(2) You can clickTraffic Grouping Set the button on the right to set the traffic grouping of the ad slot. Traffic group setting functions include: Add, copy existing, and adjust priority

5. How to verify whether the test traffic grouping is effective

1、After completing the settings in steps 3 and 4, you can open the debugging mode of TopOn SDK to verify whether the traffic grouping takes effect. View the specific usage of debugging mode

2、You can obtain the traffic groupings hit by the current device's ad slot based on the ad process log analysis in debugging mode. View the advertising process log in debug mode

  • In the advertising process log output by the SDK, segmentId is the traffic group ID of the current advertising slot.

6. Common applicable scenarios of traffic grouping

(1) Increase advertising revenue. For example, group users by "region", "installation time", etc., configure different waterfall flows for different groups, and refine operations.

(2) Filter ad requests from risky users. Risk users can be grouped by "Installation Source", "Device ID", etc., and no waterfall flow is configured for this group to achieve the purpose of filtering their ad requests and display.

(3) Used when testing formal waterfall flow under specific circumstances. Testers can be divided into groups by "device ID", etc. for testers to test online waterfall flow.

Previous
Scenario AD scene
Next
cold start strategy
Last modified: 2025-05-30Powered by