Action: Set your Segment codes!
Executive Summary
brainCloud 6 is bringing a bunch of improvements to segments. As part of those improvements, we are replacing the existing Segment IDs, which are auto-generated numeric IDs, with Segment Codes, which are short alphanumeric codes that you pick. (See later sections for rationale)
The important thing to note is that you have until the end of the day on Friday, June 5th, to set these codes - after which the system will auto-generate the codes for you! [And codes cannot be changed once set].
Tips when setting the codes:
- Codes are lowercase and limited to 12 alphanumeric characters. Letters, numbers, hyphens, and underscores allowed. No spaces.
- Try to pick meaningful names: “newbies”, “lifers”, “payers”, etc.
- Ensure that the codes in the Dev and Prod versions of your apps match up! That’s the whole point of this change - is to improve segment deployments!
Background
Segments in brainCloud have long-used Segment IDs, which are auto-generated numeric IDs. The first segment created is 1, the second is 2, and so on.
This simplistic system works fine - until you start really getting into segments - and start creating them in the prod instance of your app separately from the dev instance of your app. Even if you remember and go back to the dev instance of your app to backfill them, you’ll often find that the segment IDs in the two app instances don’t match up!
So, for instance, your “Players” segment for players who have spent more than $0 – might have a segment ID of 2 in the live version of your app - but 3 in the dev version of your app!
This wreaks havoc if you deploy from Dev → Prod, as the Dev segments will overwrite the Prod segments - and it takes a day for the segment membership to catch up!
The Solution - Segment Codes
Segment Codes are our solution to this problem. They are short 12-character codes that uniquely identify a segment. Because they are manually set, it is easy to keep them in sync between Dev and Prod.
This makes for better code as well - triggering the push notification job to a particular segment is easier to understand with a meaningful Segment Code instead of an arbitrary Segment ID.
API Impact
Note that from an API perspective, Segment IDs will continue to work. That said, we are extending all API calls to work with Segment Codes as well, and we encourage everyone to move to that mechanism.
Deployments
Finally, we are adding a new option to exclude Segments from deployment. Segments are more of a LiveOps domain element than an app design concern, so we are extending the Deployment system to allow Segments to be excluded from Deployment in the same way that Cash Products, Promotions, etc. can be now.