Session cookies keep you signed in and are always on. With your consent we also use analytics and advertising cookies. Decline and we keep only the session ones. See our Cookie Policy.

ROLearn/ Documentation / SDK
Get API key →SDK product →

Segments

A segment is a saved group of players that match a rule, for example "spent more than 1000 Robux" or "played at least 5 sessions". You build them from the events you already send, so there is nothing extra to instrument in your game.

Build a segment

Open the Segments builder in the dashboard (SDK, then Segments). A rule is made of conditions joined with AND or OR. There are two kinds of condition:

  • Event count: how many times a player fired an event, for example purchase >= 1.
  • Player attribute: a value from an event payload, for example country = "US".

The rule shape

The builder writes a small JSON definition. You rarely edit it by hand, but this is what a "paying US player" segment looks like.

segment definition
{
  "op": "and",
  "conditions": [
    { "type": "event_count", "event": "purchase", "gte": 1 },
    { "type": "player_attr", "attr": "country", "equals": "US" }
  ]
}
Attribute names are validated against a strict allowlist before they ever touch the database, so a segment rule can never inject SQL.

When it updates

Segments rebuild every night at 03:00 UTC from the latest events. A new segment is empty until that first build runs.

Where you can use them

  • Filter any analytics view down to one segment.
  • Compare two segments side by side.
  • Read how a segment responded to an A/B test or a brand activation.