Segments

Group customers, so you can reach the right ones.

A segment is a group of customers, such as VIP, New this month or Dar es Salaam. You pick who is in it by hand, or turn on Automatic segmentation and let rules decide. A customer can be in up to 20 segments picked by hand, and you can have up to 500 segments.

Create a segment

In Customers → Segments, select New segment. Give it a name, a colour, and optionally a description.

You can also create one as you go: type a new name in a customer's Segments, or in your import file.

Add customers to a segment

  • From the list: in All customers, select customers and choose Add to segment.
  • From the segment: open it and select Add customers.
  • From a customer: edit them and choose their segments.
  • By import: name segments in your file's Segments column.

To take customers out, select them in All customers and choose Remove from segment.

Automatic segments

An automatic segment fills itself. Instead of adding customers, you give it rules, such as "Purchased at least twice in the last 30 days" or "Plan is gold". Customers who match are in it, and they leave when they no longer match. No one is added or removed by hand.

  1. In Customers → Segments, select New segment, and give it a name.
  2. Turn on Automatic segmentation.
  3. Under Rules, choose whether customers match All conditions or Any condition, then select Add condition for each one, up to 10.

As you add conditions, the form shows how many customers match now, and a few of them.

ConditionMatches customers who
DetailHave a detail that is, isn't, contains, is more or less than a value; or has a value or none
ActivityDid something at least a number of times, or didn't do it; optionally in the last so many days, and only where its value is what you give, such as Link clicked with December offer
Activity totalHave an activity's values adding up to more or less than an amount, such as money spent
Any activityDid anything, or nothing, in the last so many days
AddedBecame your customer in the last so many days
SegmentAre, or aren't, in a segment you pick by hand
EngagedAre, or aren't, engaged: clicked a link, replied, chose an option or reacted in the last 30 days. Opens don't count, since email apps and read settings make them unreliable
InactiveAre, or aren't, inactive: none of that in the last 90 days
ConvertedSent, or didn't send, one of your Goomzo tracking events, such as a purchase; optionally in the last so many days
ContactHave a phone number, or an email

A value such as 25,000 is compared as a number, and Yes or No as yes or no.

Who is in an automatic segment is worked out each time you use it: when you open it, filter customers by it, or send it a broadcast. It shows on each matching customer, next to their other segments. You can have up to 50 automatic segments, and a segment stays automatic, or picked by hand, as it was made.

Delete a segment

Open the segment and select Delete segment. Its customers stay; they're only no longer grouped. A segment that an automatic segment's rules use can't be deleted until you change those rules.

Through the API

Send rules when you create a segment with POST /v1/segments:

curl https://api.goomzo.africa/v1/segments \
  -H "Authorization: Bearer $GOOMZO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Regular buyers",
    "rules": {
      "match": "all",
      "conditions": [
        { "type": "activity", "key": "purchased", "op": "atLeast", "count": 2, "withinDays": 30 },
        { "type": "contact", "op": "hasPhone" }
      ]
    }
  }'

match is all or any. Each condition has a type, and what that type needs:

typeFields
detailkey; op is is, isNot (value text, a number or true/false), contains (value text), moreThan, lessThan (value a number), isSet or isNotSet
activitykey; op is atLeast (count, 1 if left out) or none; withinDays and value (text, matched ignoring case) optional
activityTotalkey; op is moreThan or lessThan; value a number; withinDays optional
anyActivityop is some or none; withinDays
engaged, inactiveop is is or isNot: engaged in the last 30 days, or not in 90
convertedop is did or didNot; conversionId of a tracking event set up in the app; withinDays optional
addedwithinDays
segmentop is in or notIn; segmentId of a segment picked by hand
contactop is hasPhone or hasEmail

withinDays is from 1 to 3,650. A problem is named by where it is, such as rules.conditions[1].value.

  • See who matches first: send the same rules to POST /v1/segments/preview. It answers with count and the five newest matching customers.
  • What you get back: segments have kind, manual or rules, and their rules. customerCount is who matches now. A customer's segments include the automatic ones they match.
  • Change the rules with PATCH /v1/segments/{id} and new rules. A segment picked by hand can't be given rules.
  • No one is added by hand: adding customers to an automatic segment, or naming it in a customer's segments when you add customers, is refused with segment_fills_itself. Setting a customer's segments with PUT /v1/customers/{id}/segments leaves automatic ones out, so you can send back what you read.

Next steps

Last updated