Segments allow you to divide up your players based on their attributes. This is useful for notifications, promotions, and system running user script. For example, you might want to issue a heavily discounted promotion to only the group of players who have passed level 3 and not yet made a purchase. Or you might want to send a clawback notification to heavy spenders that haven't been on in a few days. 

Segments allow you to create these filters and then act on them. 

(Note: Members of segments are recalculated overnight when server load is low, so you will need to make a segment at least 1 day in advance of using it.) 

You may already notice the info of the system process for segment refreshing from the Monitoring | Global Monitoring | Recent Errors page sometimes.

From the Segments page, you can create, view, edit, and delete segments. These segments can be based on one single filter criterion or combination criteria.

Creating a segment

  • Advance to Design | Segmentation | Segments page from your development portal. Click the [+New Segment] button at the right up corner of the segments list. The Segment Panel will be opened like below. 

  • Enter an easily identified name and a helpful description for your segment, then click the [+New Criteria] button. (If you want this Segment only to track users with the isTester set, then check the [For Testers Only] checkbox)

  • Set the filter parameters

  • Select Save. If you wish to narrow your filter, add more criteria as needed. 

Testing segments

If you wish to send your segment a notification, you can advance to Design | Notification | Templates to create one. When you hit Send, the system will prompt you to indicate the segment. Select your new segment from the drop-down list and hit the Send Now button.

If you wish to target a segment for a sale, you can specify the segment that is eligible in the Design | Promotions | Scheduled page or Design | Promotions | Automated page.

If you wish to target a segment for running a script for, you can call RunBatchUserScript() with segments Ids specified from the parameter.

You also can call GetMySegmentsLegacy() from the service of the segment to check which segments the current player belongs to. You will get the list of segments info as below:

{
"data": {
"segments": [
{
"segmentId": 2,
"name": "xpgreater10"
},
{
"segmentId": 3,
"name": "abtestunder50"
}
]
},
"status": 200
}

For the usage of the rest available segment service APIs, refer to APIRef here.

Did this answer your question?