Capture events and set up segments
UpdatedThe real power of Customer.io comes from using the things you know about profiles, and the things they do, to organize them into groups, automatically trigger automations, and so on.
How it works
You can use attributesA key-value pair that you associate with a person or an object—like a person’s name, the date they were created in your workspace, or a company’s billing date etc. Use attributes to target people and personalize messages. and eventsSomething that a person in your workspace did. Events can trigger automations, add people to segments, etc, and you can use properties from events to personalize messages. to automatically group profiles into segmentsA group of people who match a series of conditions. People enter and exit the segment automatically when they match or stop matching conditions. and trigger automations. This helps you automate your messaging strategy, so you send messages to your audience at the right times—without having to manually update lists or trigger messages.
attributes) b(profile performs
event) a-->c{Does profile match
segment criteria?} c-->|yes|d(profile joins
segment) d-->e{Does this trigger
an automation?} e-->|yes|f(profile enters
automation journey) b-.->|events can be
segment criteria|c b-->e
Data Index: Know your data
If you’re going to use attributes and events to group profiles, trigger automations, and so on, you should know what attributes and events are available to you.
If you’re not already aware of the data coming into your system, you can see the attributes and events in your system under Integrations > Data Index.


The Data Index shows all of the attributes in your system and a list of events performed within the last 30 days. If you don’t see an attribute or event that you think you might need, you may need to update your integration to send the right attributes and events to Customer.io!
Find an individual’s data on the Profiles page
Segments
A Segment is a group of profiles in your workspace—profiles who share the same attributes, performed the same events, and so on. You can use segments to trigger automations, as the audience for a broadcast, as a goal for an automation (e.g. you want profiles to join a particular segment), and so on.
You can add profiles to segments manually or automatically—which we call data-driven segments.
In general, you should use data-driven segments whenever possible, because they update as your audience’s data changes—they’re easier to set up and update automatically. Profiles join and leave data-driven segments automatically based on whether they match the conditions you set.
But manual segments can be helpful when you don’t want a segment to update in real time—like if you want to maintain a static list of profiles you met at a conference. Unlike data-driven segments, profiles don’t join or leave manual segments automatically. You can add profiles to manual segments by uploading a CSV file, or by adding them to a segment as part of an automation or broadcast workflow.
Data-driven segments
Data-driven segments group profiles based on the data you send to Customer.io, so profiles join the segment when they match certain criteria, and leave it when they stop matching the criteria.
These kinds of segments are an essential part of your marketing automation plans because you can use them as automation triggers. In the same way that profiles join segments when they match your criteria, they can also start automation journeys when they join your segments.
With well-defined segments, you can automate your messaging strategy and send messages to your audience at the right times—without having to manually update lists or trigger messages.
You can define data-driven segments on the Segments page.


You can use most of your customer’s data as segment criteria, including attributes, events, page views, and devices. You can also use metadata from inside Customer.io like when profiles click tracked links in emails, open messages, etc.
Example segments
Lifetime value:
Imagine Profiles have a lifetime_value attributeA key-value pair that you associate with a person or an object—like a person’s name, the date they were created in your workspace, or a company’s billing date etc. Use attributes to target people and personalize messages. that you increase when they pay you. You could set up a segmentA group of people who match a series of conditions. People enter and exit the segment automatically when they match or stop matching conditions. that profiles join when their lifetime_value value is greater than a certain amount; for our example below, we’re using 25000.
You might trigger an automation based on this segment to send special messages to your high-value customers!


High value offers: Let’s say you send events to Customer.io when your customers visit high value offers on your site. You might create a segment that matches profiles that have seen the same high value offer five times in the past week but haven’t used it or made a purchase yet. The segment could trigger an automation that sends those users a special offer or nudge that encourages them to finish their purchase.
Manual Segments
Manual segments let you define exactly who belongs in the segment, and they’ll remain there until you remove them. They’re good for keeping static lists of profiles—like people you met at a conference, or people who signed up for a beta program.
You can add profiles to (and remove them from) manual segments by uploading a CSV file or invoking our API. You can remove profiles from manual segments as a part of an automation or broadcast workflow.


Events
Events are the things that profiles do in your system—like signing up, logging in, or making a purchase. You can use events to trigger automations, as segment criteria, and so on.
event)-->b{Is the event a
automation trigger?} a-->c{Is the event
segment criteria?} b-->|yes|d(profile starts
automation journey) c-->|yes|e(profile joins
segment) e-->f{Is the segment a
automation trigger?} f-->|yes|d
Unlike attributes, which you can set manually, events are a standard part of your integration(s) with Customer.io. You’ll need to send events into Customer.io programmatically to take advantage of your audience’s real-time activities.
Beyond their use in Customer.io, events are a typical way to pass data outAn integration that sends data out of Customer.io. to other services. For example, you might send events to Customer.io to trigger automations and send those same events to an analytics platform like Mixpanel.
Event data
Each event carries data with it. Data properties can provide important information about the event a profile performed. For example, if you send a purchase event, you might include product_name and price properties so you know what a profile bought and how much it cost.
You can use these properties in a few different ways:
- Fine-tuning automation triggers: for example, you might want to trigger an automation that sends a coupon to profiles when they spend over a certain amount in a purchase.
- Personalizing messages with liquidA syntax that supports variables, letting you personalize messages for your audience. For example, if you want to reference a person’s first name, you might use the variable
{{customer.first_name}}.: for example, if someone signs up for an online class, you might send them a message that reminds them of the class they signed up for, and includes a link to the class materials.
Here’s an example of a signup event that includes some relevant properties.
{
"type": "track",
"event": "Course Started",
"properties": {
"course_in_series": 1,
"course_format": "pass/fail",
"title": "Intro to Customer.io"
}
}
Page and Screen View Events
There are two very specific kinds of events: page and screen views. These events represent the pages (web) and screens (mobile) that your audience visits.
These events work much like other events. You can do everything you do with standard events, plus two special things:
- Create special segments based on the pages and screens your audience visits.
- Determine the pages/screens on which profiles receive in-app messages. We call these Page Rules.


Capture page views automatically
Semantic events
Some events have special meaning in Customer.io or your downstream destinationsAn integration that sends data out of Customer.io—your data’s ultimate destination.. We call these semantic events. You can use semantic events to perform actions in Customer.io (and other destinations).
For example, we don’t have a call from our source libraries to remove a profile from your Customer.io workspace using our JavaScript source snippet. So, if you need to delete a profile from your workspace, you can send an event called Delete Profile.
// Remove a profile from your Customer.io workspace
cioanalytics.track("User Deleted");
Semantic events are based on the event name. You can set up your own events for any destination, but we’ve pre-defined a significant number of these events to support various destinations—so you don’t have to define them yourself if you’re just getting started. See Semantic Events for more information.
