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.
- In Customers → Segments, select New segment, and give it a name.
- Turn on Automatic segmentation.
- 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.
| Condition | Matches customers who |
|---|---|
| Detail | Have a detail that is, isn't, contains, is more or less than a value; or has a value or none |
| Activity | Did 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 total | Have an activity's values adding up to more or less than an amount, such as money spent |
| Any activity | Did anything, or nothing, in the last so many days |
| Added | Became your customer in the last so many days |
| Segment | Are, or aren't, in a segment you pick by hand |
| Engaged | Are, 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 |
| Inactive | Are, or aren't, inactive: none of that in the last 90 days |
| Converted | Sent, or didn't send, one of your Goomzo tracking events, such as a purchase; optionally in the last so many days |
| Contact | Have 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:
type | Fields |
|---|---|
detail | key; op is is, isNot (value text, a number or true/false), contains (value text), moreThan, lessThan (value a number), isSet or isNotSet |
activity | key; op is atLeast (count, 1 if left out) or none; withinDays and value (text, matched ignoring case) optional |
activityTotal | key; op is moreThan or lessThan; value a number; withinDays optional |
anyActivity | op is some or none; withinDays |
engaged, inactive | op is is or isNot: engaged in the last 30 days, or not in 90 |
converted | op is did or didNot; conversionId of a tracking event set up in the app; withinDays optional |
added | withinDays |
segment | op is in or notIn; segmentId of a segment picked by hand |
contact | op 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
rulestoPOST /v1/segments/preview. It answers withcountand the five newest matchingcustomers. - What you get back: segments have
kind,manualorrules, and theirrules.customerCountis who matches now. A customer'ssegmentsinclude the automatic ones they match. - Change the rules with
PATCH /v1/segments/{id}and newrules. 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
segmentswhen you add customers, is refused withsegment_fills_itself. Setting a customer's segments withPUT /v1/customers/{id}/segmentsleaves automatic ones out, so you can send back what you read.
Next steps
Last updated