Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Segmenting your Contacts


(information)

Info

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(link takes you to an external page).

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.

(information)

Info

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.


How Segments Work

how-segments-work page anchor

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.


Creating a Segment with Marketing Campaigns

creating-a-segment-with-marketing-campaigns page anchor

To create a segment, login to the Twilio SendGrid App and complete the following steps.

  1. Navigate to Marketing and then select Contacts(link takes you to an external page) .
  2. Click on the Create dropdown button, and then the New Segment option.
The SendGrid App with the Create dropdown extended and 'New Segment' highlighted in the dropdown.
  1. Enter a Segment Name .
  2. Choose Segment all contacts or Segment an existing list .
The contacts menu inside the SendGrid App, displaying the segment name field and list from which the segment should be built.
(information)

Info

If you're segmenting an existing list, you can click the action menu to the right of the list name from the Contacts page(link takes you to an external page) and select "Create Segment" directly.

  1. To segment an existing list, select a list from the Existing List drop-down.
  2. In the Who are you targeting? section, start building your first condition by choosing a field from the drop-down.
  3. Choose from the list of available operators .
  4. Enter the desired value you want to segment by.
  5. You can add multiple conditions and choose to join them with AND or OR . AND will require both conditions to be true; OR will qualify a contact for whom either condition is true. This functionality allows you to further refine your segments to target your audience with precision.
(information)

Info

Segments can have any combination of custom field, reserved field, Email Activity, Single Send, or Automation conditions.

  1. Once you are finished adding conditions, click Save Segment .
The segment builder inside Marketing Campaigns, displaying a new segment with a City condition set to 'Denver' and a State, Province, Region condition set to 'Colorado'.

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.

(information)

Info

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:

  • New contacts being added to or updated within Marketing Campaigns, whether via CSV upload, API integration, Signup Forms, or manual changes.
  • Contact engagement behavior, such as opening or clicking an email in a way that's relevant to your segment conditions.
  • A change you make to the conditions that define your segment.

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.

(information)

Info

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.

(information)

Info

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(link takes you to an external page) page as well as on the detail page of your segment.

The Contacts landing page in the Marketing Campaigns App.
A segment detail page with a tool tip indicating the next estimated refresh time.

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.

(information)

Info

Marketing Campaigns will pull a segment at the time of send, reflecting the near-real-time segment population.


Manually refreshing a segment

manually-refreshing-a-segment page anchor

Customers on Marketing Campaigns basic and advanced plans(link takes you to an external page) 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:

  • One refresh per hour per segment. The clock resets at the time of the refresh, allowing a new refresh one hour later.
  • Two refreshes per segment per day. The clock resets at midnight in the user's stored time.
  • Ten refreshes per day across all segments. The clock resets at midnight in UTC time.

To manually refresh a segment

  1. Navigate to a segment's detail page and click the manual refresh icon (a ring with an arrow-shaped cap)
The manual refresh icon with a tool tip explaining a refresh. The icon is a circle with an arrow-shaped cap.

Segmentation Fields and Types

segmentation-fields-and-types page anchor

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.

Contact Profile Fields

contact-profile-fields page anchor
Field NameField Type
First NameText
Last NameText
EmailText
Phone Number IDText
External IDText
Anonymous IDText
Address Line 1Text
Address Line 2Text
CityText
State Province RegionText
Postal CodeText
CountryText
Date AddedDate
Last UpdatedDate
Field NameField Type
Last ClickedEmail Activity*
Last OpenedEmail Activity*
Last EmailedEmail Activity*
Field NameField Type
Single Send ActivitySingle Send**
Field NameField Type
Automation ActivityAutomation**

* 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.

Operators Available for Contact Profile and Custom Fields

operators-available-for-contact-profile-and-custom-fields page anchor

The operators available on a field depend on the field type (Text, Date, Number).

Date Field Operators

date-field-operators page anchor

Conditions using Date field operators will filter contacts based on the contact field compared with the datetime value provided in the condition.

Operator NameDescription
isMatches contacts that have the datetime value for the field
is notMatches contacts that do not have the datetime value for the field
is blankNo value is set for the field
is not blankAny value is set for the field
is afterMatches the datetime value that occurs after the provided value for the field
is at or afterMatches the datetime value that matches or is after the provided value for the field
is beforeMatches the datetime value that occurs before the provided value for the field
is at or beforeMatches the datetime value that matches or is before the provided value for the field
betweenMatches 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 betweenMatches the datetime value that occurs before the start date and after the end date for the provided value of that field
is withinMatches 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 withinMatches 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
onMatches the datetime value that occurs at any time on the date provided
not onMatches 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 NameDescription
isMatches contacts that have the numeric value for the field
is notMatches contacts that do not have the numeric value for the field
is blankNo value is set for the field
is not blankAny value is set for the field
is greater thanMatches any numeric value that is greater than the provided value for the field
is less thanMatches any numeric value that is less than the provided value for the field
is equal or greater thanMatches any numeric value that matches or is greater than the provided value for the field
is equal or less thanMatches any numeric value that matches or is less than the provided value for the field
is betweenMatches 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 betweenMatches 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 NameDescription
isMatches contacts that have the provided value for the field
is notMatches contacts that do not have the provided value for the field
is blankNo value is set for the field
is not blankAny value is set for the field
containsMatches any value that may include other text as part of the value
does not containMatches any value that does not include the provided value
starts withMatches any value that begins with the provided value
does not start withMatches any value that does not begin with the provided value
ends withMatches any value that ends with the provided value
does not end withMatches any value that does not end with the provided value

Operators available for Email Activity Fields

operators-available-for-email-activity-fields page anchor

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 NameDescription
isMatches contacts that have the datetime value for the field
is notMatches contacts that do not have the datetime value for the field
is afterMatches the datetime value that occurs after the provided value for the field
is at or afterMatches the datetime value that matches or is after the provided value for the field
is beforeMatches the datetime value that occurs before the provided value for the field
is at or beforeMatches the datetime value that matches or is before the provided value for the field
betweenMatches 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 betweenMatches the datetime value that occurs before the start date and after the end date for the provided value of that field
is withinMatches 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 withinMatches 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
onMatches the datetime value that occurs at any time on the date provided
not onMatches the datetime value that does not fall at any time on the date provided

Operators available for Single Send Fields

operators-available-for-single-send-fields page anchor

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 NameDescription
was sentAny contacts who were sent any Single Send or a specific Single Send in the specified time range
has clickedAny contact who has clicked any Single Send or a specific Single Send in the specified time range
has openedAny contact who has opened any Single Send or a specific Single Send in the specified time range
was not sentAny contacts who were not sent any Single Send or a specific Single Send in the specified time range
has not clickedAny contact who has not clicked any Single Send or a specific Single Send in the specified time range
has not openedAny contact who has not opened any Single Send or a specific Single Send in the specified time range

Operators available for Automation Fields

operators-available-for-automation-fields page anchor

Automation conditions will filter contacts who have engaged with a particular Automation or any Automation based on the constraints of the condition.

Operator NameDescription
was sentAny contacts who were sent any Automation or a specific Automation in the specified time range
has clickedAny contacts who has clicked any Automation or a specific Automation in the specified time range
has openedAny contacts who has opened any Automation or a specific Automation in the specified time range
was not sentAny contacts who were not sent any Automation or a specific Automation in the specified time range
has not clickedAny contact who has not clicked any Automation or a specific Automation in the specified time range
has not openedAny contact who has not opened any Automation or a specific Automation in the specified time range

Adding Multiple Conditions with a Segment

adding-multiple-conditions-with-a-segment page anchor

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.

(warning)

Warning

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:

  1. From the Contact Lists page, click the Action Menu next to the name of the segment you wish to duplicate.
  2. Select Duplicate .
Duplicate a segment from the contact list page.

To export a segment from the segment details page:

  1. Click Segment Options to open the drop-down menu.
  2. Select Duplicate .
Duplicate a segment from the segment detail page.

To export a segment from the Contact List Page:

  1. Click the Action Menu next to the name of the segment you wish to export.
  2. Select Export .

To export a segment from the segment details page:

  1. Click Segment Options to open the drop-down menu.
  2. Select Export .

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.

(information)

Info

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.

  1. Navigate to Marketing > Contacts(link takes you to an external page) in the Twilio SendGrid application.
  2. Click the action menu (three dots) to the right of your segment.
  3. Click Delete This Segment from the menu that appears.
  4. A dialog will then load. Click the Delete This Segment button to delete your segment.
  5. The dialog will close and the segment be removed.

Delete a Segment's contacts from your account

delete-a-segments-contacts-from-your-account page anchor

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.

  1. Navigate to Marketing > Contacts(link takes you to an external page) in the Twilio SendGrid application.
  2. Click the action menu (three dots) to the right of your segment.
  3. Click Export from the menu that appears.
  4. The Active Exports contacts page will load. Click Download CSV for the segment you exported.
  5. Return to the Marketing > Contacts(link takes you to an external page) page in the Twilio SendGrid App.
  6. Click the Add Contacts button at the top of the page and select Upload a CSV from the menu that appears.
  7. The Upload CSV page will load. Select Add Contacts to a new list and name your new list. It may be helpful to name the list something that stands out such as "Delete Me."
  8. Drag and drop your downloaded CSV or select it using your system dialog by clicking select a CSV file to upload .
  9. Click Next: Review CSV Upload .
  10. A new page will load where you may be asked to map any unmapped contact fields. You can select Skip Unmapped at the top of the page because these contacts will be deleted.
  11. Click the Next: Add Contacts button at the top or bottom of the page (it appears in both places).
  12. Allow time for the upload to complete, usually around 30 minutes after receiving the successful upload confirmation email.
  13. Once the contact list populates with the expected number of contacts, you may delete the list and its associated contacts.
  14. Return to Marketing > Contacts(link takes you to an external page) in the Twilio SendGrid application.
  15. Click the action menu (three dots) to the right of your now populated list.
  16. Click Delete This List from the menu that appears.
  17. A dialog will then load asking if you want to delete the list only or the list and its associated contacts.
  18. To delete the list and permanently delete its associated contacts from your All Contacts list, check the box labeled Delete this list and permanently delete all <number> contacts associate with this list from my account .
  19. You will see a delete button labeled Delete This List and All <number> Contacts . Click this delete button.
  20. The dialog will close and the list and its associated contacts will be removed.


Rate this page: