The content on this page describes the experience in the latest version of Marketing Campaigns. If you're using the legacy version of Marketing Campaigns, your experience may be different. To explore Marketing Campaigns plans and upgrade, click here.
Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience.
Marketing Campaigns supports up to 200 segments per user.
Custom fields, reserved fields, and engagement data like opens and clicks, provide unique information you can use to identify contacts for different segments. As your contacts' traits change or you add more contacts that meet the criteria of your segment, your segments will update to reflect these changes. For example, a segment populated using the criteria, "lives in Denver" or, "is under 30 years old" will change as your contacts age or their addresses change.
Segments can pull from All Contacts or any of your more narrowly defined lists.
Segments are created by comparing your contacts against criteria you define. If a contact matches the specified criteria, they will be included in your segment. Engagement data such as "opened" or "clicked" will add contacts who have engaged in this behavior with one of your messages. Whether or not a contact meets your defined criteria is evaluated using the combination of conditions you create. Each condition consists of three parts: fields, operators, and values.
Fields
The first part of the condition, the field, is the data field you want to filter your contacts by. Fields include traits such as "First Name," "Email," or "City" and engagement data such as "Last Clicked." For a full list of available fields, see the Segmentation fields and types tables.
Operators
Operators are the second part of the expression, and they define how your contacts should be evaluated. All fields have a data type assigned to them (text, number, date, Single Send, Automation); this type will determine which operators are available. For example, "Last Clicked" is a date field, and it has date operators such as "is after" and "is before" available. For a full list of operators available by field type, see the Operators available by field type section.
Values
The last part of the expression is a value. The value is compared to the field using the operator. For example, you may select the field, "City." City is a text-type field, so you can then choose "is" from the available operators for that field type. You can then add the value, "Denver." This expression will check your contacts for entries who live in Denver and include all who do in your segment.
You can build precisely targeted segments by using multiple conditions to filter your contacts. The previous example is among the simplest segments possible using Marketing Campaigns.
To create a segment, login to the Twilio SendGrid App and complete the following steps.
If you're segmenting an existing list, you can click the action menu to the right of the list name from the Contacts page and select "Create Segment" directly.
Segments can have any combination of custom field, reserved field, Email Activity, Single Send, or Automation conditions.
Once your segment is processed, you will see a count of all contacts who meet your segment conditions, as well as a sample of these 50 contacts. To see all contacts included in your segment, click Export CSV to download a complete file.
Segments built using engagement data such as "was sent" or "clicked" will take approximately 30 minutes to begin populating.
Contacts will be added to or removed from your segment as they meet or no longer meet the conditions of your segment. This can be driven by:
Typically, existing contacts who meet your criteria will begin to appear in your segment searches within 15 minutes. You can see all contacts who are included in the segment at any given time by clicking Export CSV. Segments are pulled at the time of an export; this means that an exported CSV will reflect a near-real-time segment population. To check for a specific contact, you can search by one of the contact's identifiers: email
, phone_number_id
, external_id
, or anonymous_id
.
Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes.
Segments built using engagement data such as "was sent" or "clicked" will take approximately 30 minutes to begin populating.
Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours.
You can see an estimate of the next scheduled segment refresh on the Contacts page as well as on the detail page of your segment.
Automations with entry criteria of a contact entering a segment will be triggered according to the same schedule as the segment sample refresh cadence described above.
However, when you send a Single Send to a segment, Marketing Campaigns will pull the segment at the time of send, reflecting the near-real-time segment population.
Marketing Campaigns will pull a segment at the time of send, reflecting the near-real-time segment population.
Customers on Marketing Campaigns basic and advanced plans can manually refresh a segment outside of the regular refresh cadence. This allows you to control when a segment is processed.
Manual segment refreshes are limited to:
To manually refresh a segment
The following tables list the available reserved fields and the fields' data types. Reserved fields are present in your account by default. Your account will also include any Custom Fields you add. The operators available for each type are included in the section following these field tables.
Field Name | Field Type |
---|---|
First Name | Text |
Last Name | Text |
Text | |
Phone Number ID | Text |
External ID | Text |
Anonymous ID | Text |
Address Line 1 | Text |
Address Line 2 | Text |
City | Text |
State Province Region | Text |
Postal Code | Text |
Country | Text |
Date Added | Date |
Last Updated | Date |
Field Name | Field Type |
---|---|
Last Clicked | Email Activity* |
Last Opened | Email Activity* |
Last Emailed | Email Activity* |
Field Name | Field Type |
---|---|
Single Send Activity | Single Send** |
Field Name | Field Type |
---|---|
Automation Activity | Automation** |
* Email Activity fields have their own Email Activity type. After selecting one of the operators available for this type, you'll define the time period in which the engagement occurred.
** Single Send Activity and Automation Activity fields have their own Single Send and Automation types. After selecting one of the operators available for these types, you'll choose whether the operator applies to any Single Send or Automation or to a specific Single Send or Automation. You will then define the time period in which the engagement occurred.
The operators available on a field depend on the field type (Text, Date, Number).
Conditions using Date field operators will filter contacts based on the contact field compared with the datetime value provided in the condition.
Operator Name | Description |
---|---|
is | Matches contacts that have the datetime value for the field |
is not | Matches contacts that do not have the datetime value for the field |
is blank | No value is set for the field |
is not blank | Any value is set for the field |
is after | Matches the datetime value that occurs after the provided value for the field |
is at or after | Matches the datetime value that matches or is after the provided value for the field |
is before | Matches the datetime value that occurs before the provided value for the field |
is at or before | Matches the datetime value that matches or is before the provided value for the field |
between | Matches the datetime value that occurs on or after the start date and on or before the end date for the provided value for the field |
not between | Matches the datetime value that occurs before the start date and after the end date for the provided value of that field |
is within | Matches the datetime value that occurs between the date and time in the past based on the duration and the current datetime. Duration can be selected in days, months or years |
is not within | Matches the datetime value that occurs before the date and time in the past based on the duration and the current datetime. Duration can be selected in days, months or years |
on | Matches the datetime value that occurs at any time on the date provided |
not on | Matches the datetime value that does not fall at any time on the date provided |
Conditions using Number Field operators will filter contacts based on the contact field compared with the numeric value provided in the condition.
Operator Name | Description |
---|---|
is | Matches contacts that have the numeric value for the field |
is not | Matches contacts that do not have the numeric value for the field |
is blank | No value is set for the field |
is not blank | Any value is set for the field |
is greater than | Matches any numeric value that is greater than the provided value for the field |
is less than | Matches any numeric value that is less than the provided value for the field |
is equal or greater than | Matches any numeric value that matches or is greater than the provided value for the field |
is equal or less than | Matches any numeric value that matches or is less than the provided value for the field |
is between | Matches any numeric value that matches or is greater than the minimum value and matches or is less than the maximum value for the field |
is not between | Matches any numeric value that is less than the minimum value and is greater than the maximum value for the field |
Conditions using Text Field operators will filter contacts based on the contact field compared with the string value provided in the condition.
Operator Name | Description |
---|---|
is | Matches contacts that have the provided value for the field |
is not | Matches contacts that do not have the provided value for the field |
is blank | No value is set for the field |
is not blank | Any value is set for the field |
contains | Matches any value that may include other text as part of the value |
does not contain | Matches any value that does not include the provided value |
starts with | Matches any value that begins with the provided value |
does not start with | Matches any value that does not begin with the provided value |
ends with | Matches any value that ends with the provided value |
does not end with | Matches any value that does not end with the provided value |
Operators available on an Email Activity field are similar to Date fields with some exceptions—"is blank" and "is not blank" are not included on Email Activity fields. Email Activity conditions will filter contacts who have engaged with a Single Send or Automation based on the constraints of the condition.
Operator Name | Description |
---|---|
is | Matches contacts that have the datetime value for the field |
is not | Matches contacts that do not have the datetime value for the field |
is after | Matches the datetime value that occurs after the provided value for the field |
is at or after | Matches the datetime value that matches or is after the provided value for the field |
is before | Matches the datetime value that occurs before the provided value for the field |
is at or before | Matches the datetime value that matches or is before the provided value for the field |
between | Matches the datetime value that occurs on or after the start date and on or before the end date for the provided value for the field |
not between | Matches the datetime value that occurs before the start date and after the end date for the provided value of that field |
is within | Matches the datetime value that occurs between the date and time in the past based on the duration and the current datetime. Duration can be selected in days, months or years |
is not within | Matches the datetime value that occurs before the date and time in the past based on the duration and the current datetime. Duration can be selected in days, months or years |
on | Matches the datetime value that occurs at any time on the date provided |
not on | Matches the datetime value that does not fall at any time on the date provided |
Single Send conditions will filter contacts who have engaged with a particular Single Send or any Single Send based on the constraints of the condition.
Operator Name | Description |
---|---|
was sent | Any contacts who were sent any Single Send or a specific Single Send in the specified time range |
has clicked | Any contact who has clicked any Single Send or a specific Single Send in the specified time range |
has opened | Any contact who has opened any Single Send or a specific Single Send in the specified time range |
was not sent | Any contacts who were not sent any Single Send or a specific Single Send in the specified time range |
has not clicked | Any contact who has not clicked any Single Send or a specific Single Send in the specified time range |
has not opened | Any contact who has not opened any Single Send or a specific Single Send in the specified time range |
Automation conditions will filter contacts who have engaged with a particular Automation or any Automation based on the constraints of the condition.
Operator Name | Description |
---|---|
was sent | Any contacts who were sent any Automation or a specific Automation in the specified time range |
has clicked | Any contacts who has clicked any Automation or a specific Automation in the specified time range |
has opened | Any contacts who has opened any Automation or a specific Automation in the specified time range |
was not sent | Any contacts who were not sent any Automation or a specific Automation in the specified time range |
has not clicked | Any contact who has not clicked any Automation or a specific Automation in the specified time range |
has not opened | Any contact who has not opened any Automation or a specific Automation in the specified time range |
When using more than one condition to segment your contacts, you can select AND or OR as options, where AND requires both conditions to be true and OR requires either condition to be true. Once you've selected the field, operator, and value, you can layer additional conditions in the segment to narrow the results to a more targeted audience.
Segments can combine more than one engagement activity condition using AND or OR. Segments created prior to October 2021 used API version 1 and do not support more than one engagement activity condition. Please duplicate or create a new Segment to leverage all of the features available for engagement activity.
Duplicating a segment eliminates the time and effort needed to recreate a complex segment from scratch in order to make a few changes or tweaks to reach a different audience. Follow these steps to create a copy of an existing segment.
To duplicate a segment:
To export a segment from the segment details page:
To export a segment from the Contact List Page:
To export a segment from the segment details page:
This triggers Twilio SendGrid to send an email to the primary email address on the account. The email includes a link to download the CSV of all the contacts in the list and their associated custom field values.
The download link for your CSV export will be valid for 12 hours.
When you delete a segment by following the instructions in this section, the contacts associated with that segment will remain in your account. If you want to remove the contacts associated with a segment from your All Contacts list, see the Delete a segment's contacts from your account section.
To permanently remove the contacts associated with a segment from your All Contacts list, you will first export the contacts to a CSV. The CSV can then be used to create a contact list whose contacts can be removed from your account. The process is detailed in the following steps.