Custom Segments

API Reference

Custom Segments are exposed via an API resource called Segments.

What is a Custom Segment?

A Custom Segment is a way to classify Memberships into special segments that are not already supported by Hatch's other types of Audiences. A Custom Segment is created in Hatch, but the calculation and application of those segments are left to data analytics or business intelligence systems that the client controls.

How are Custom Segments configured?

First, Hatch must be made aware of Custom Segments by the creation of a Segment. The ID of the Segment should be noted, as it will be used when applying segments to Membership, Offers, or Rewards.

Custom Segments must be applied by adding (or removing) a relationship between the segment and the appropriate memberships. The presence of such a relationship indicates that the membership is "in" a segment.

Custom Segments may then be applied directly to a reward by adding (or removing) a relationship between a reward and the appropriate segments. By tagging a reward with one or more segments, the Hatch API will indicate whether a membership is eligible to redeem a reward when calling the Membership Rewards endpoint. When a aembership is not in a required segment, the reward's eligible field will read false, and the visible_status field will read missing_required_segments. Rewards that are tagged with no segments will be visible to all memberships.

Custom Segments may also be applied to an offer by creating the appropriate Audience and associating it to the given offer. Similar to rewards, the presence of a segment-based audience will influence the eligible and visible_status fields based on the segments that have been applied to the membership, as well as the type of audience that has been created.