Skip to main content
All CollectionsPortal-X Pages
Design | Segmentation | Segments
Design | Segmentation | Segments

Target specific types of players based on their attributes

Jason Liang avatar
Written by Jason Liang
Updated over 8 months ago

Segments allow you to divide up your players based on their attributes. Segments are useful for filtering Push Notifications and Scheduled Promotions, as well as for triggering Auto Promotions, and system-running user scripts.

For example, you might want to issue a heavily discounted promotion to only the group of players who have passed level 3 and have 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 the 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.

On the Segments page, you can generate, access, modify, and remove segments. These segments may be established on a singular filter criterion or a compilation of 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 accordingly based on the criteria you selected.

  • 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 segment 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 below:

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

For the usage of the remaining available segment service APIs, refer to API docs here.

Did this answer your question?