<commit_before>---
layout: page
weight: 60
title: Lists and Segmentation
navigation:
  show: true
seo:
  title: Lists and Segmentation
  override: true
  description:
---

<iframe src="https://player.vimeo.com/video/121404093" width="700" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

{% anchor h2 %}
What are Lists and Segments?
{% endanchor %}

Lists are simply static collections of Marketing Campaigns contacts. By default, any new contacts you add are stored under ALL CONTACTS. You may create new lists when adding contacts either manually, or when uploading a CSV (comma separated values) file.

Segments are dynamic collections of Marketing Campaigns contacts grouped together, or segmented, based on criteria you define. This can include data you track about them, such as gender, location, or package type, or how they’ve engaged with your emails previously. You can create a segment that pulls from ALL CONTACTS or from a specific existing list.

Segments are dynamically updated over time as you add customers who meet the criteria of your segment, or as the traits of your contacts change. For example, a segment with the criteria ”opened an email within 30 days” will evolve as contacts engage (or don’t engage) with your email. Segmentation can be especially useful to ensure that you are targeting the best recipients for your campaign.

{% info %}
You must create at least one list or segment in order to send a campaign.
{% endinfo %}

{% anchor h2 %}
Managing Your Lists
{% endanchor %}

<iframe src="https://player.vimeo.com/video/227937591" width="700" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

All of your list management features can be reached through the gear icon on the main contacts page. Just click the icon on the right side of your list title to see Export, View List, Edit List, and Delete options.

![]({{root_url}}/images/lists_2.png "List Management Options")

{% anchor h3 %}
Change the List Name
{% endanchor %}

To change the name of a list, view the list and then click the pencil icon next to the name of the list at the top of the page. You will be able to edit the name and then hit your enter key to save the change.

![]({{root_url}}/images/lists_1.png "Change your list name")

{% anchor h3 %}
Edit a List
{% endanchor %}

When you select the “Edit List” option, you will be shown the upload contacts options that will allow you to add contacts directly to this list. You will also be able to create a segment of this list directly from this window.

{% anchor h3 %}
Delete a List
{% endanchor %}

If you would like to delete a list, go to [Contacts]({{site.marketing_campaigns_url}}/contacts) where you will see a list of your contacts, then click the gear icon in the same row as your list name and select “Delete”. Once you have confirmed that you do in fact want to delete this list, only the association of a contact to this list will be deleted. Your contact’s information will continue to exist in your contact database.

{% anchor h3 %}
Create a List
{% endanchor %}
You create lists when you upload contacts, please check out our information on [uploading contacts]({{root_url}}/User_Guide/Marketing_Campaigns/contacts.html#-Uploading-Contacts) for more information.

{% info %}
You can create up to 100 lists.
{% endinfo %}

{% anchor h3 %}
Add Contacts to a list
{% endanchor %}

To add contacts to a list, click the gear icon next to the list name and select “Edit List”. A window will pop out where you can upload a new CSV or manually add a contact.

{% anchor h3 %}
Remove Contacts From a List
{% endanchor %}

Click on the name of your list to view all the contacts on the list. Check the box next to the contacts you would like to remove. You will notice that a button at the top right corner will keep track of how many contacts you have selected. Click the button with the selected count and choose the option “Remove from this list” to take these contacts off the list.

{% info %}
Choosing “Delete” will permanently remove the contacts from your contact database. You cannot roll back this change through the UI without re-adding the contacts manually or via a CSV.
{% endinfo %}

If you would like to remove these contacts from your contact database, you can do that by selecting “Delete”.


{% anchor h2 %}
Create a Segment
{% endanchor %}

<iframe src="https://player.vimeo.com/video/229916004" width="700" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

You can create a new segment with multiple conditions based on the information you have stored about your contacts. This
includes email, first_name, last_name, and all of the custom fields you have created prior to making this segment.

The fields `Date Added` and `Last Updated` are system generated. `Date Added` refers to the date the contact record was first created on your account. `Last Updated` refers to the date the contact was last updated. This could have been any of the following: a manual field update, an import that updated several qualities of this record or an API call that automatically updated this record.

{% info %}
You can create up to 400 segments.
{% endinfo %}

*To create a Segment:*

1. Navigate to **Marketing** and then select **Contacts**.
1. Click **Create Segment**. 
1. Choose either **Segment all contacts** or **Segment an exisiting list**.
1. Enter a *Segment Name*.
1. If you chose to segment an existing list, select a list from the *Select List to Segment* drop-down. 

1. In **Select Condition** choose a desired condition or custom field.
1. In **Select Criteria** choose from a list of available operators based on the chosen condition. (`IS`, `IS NOT`, `IS BEFORE`, `IS AFTER`, `CONTAINS WORD`, etc.)

  Different operators will show up depending on the type of condition or custom field selected. e.g. a field that is a “number” will show `GREATER THAN`, `LESS THAN`, and `EQUALS` as options where instead a “text” field will
show `IS` and `IS NOT` as options.

1. Select **+** to add additional conditions.

 You will be able to select `AND` or `OR` as options, where `AND` requires both conditions to be true and `OR` requires either condition to be true.
 
{% info %}
You can add up to 15 different conditions per segment.
{% endinfo %}

![]({{root_url}}/images/lists_3.png "Example of a Segment requiring countries to be either U.S. or Canada")

You can also segment your users by their engagement with your email campaigns. You can then market to your users based on how
engaged they are with a specific campaign. This is especially useful for doing things like rewarding high engagement users.

*To create this Segment:*

1. Create a new Segment.
1. In **Select Condition** choose **Engagement: Opens** or **Engagement: Clicks**

![]({{root_url}}/images/lists_engagement_segment_1.png "User Engagement Segment")


{% anchor h3 %}
Export a Segment
{% endanchor %}

*To export a Segment:*

1. Click the gear icon in your Segment's row
1. Choose **Export**

  This will trigger SendGrid to send an email to the primary email address on the account that includes a link to
download the CSV of all the contacts in the list and their associated custom field values.
The CSV export email will look like:

![]({{root_url}}/images/lists_4.png "CSV Export Email")

{% info %}
The download link for your CSV export will be valid for 24 hours.
{% endinfo %}
<commit_msg>Update lists.md<commit_after>---
layout: page
weight: 60
title: Creating and exporting segments
navigation:
  show: true
seo:
  title: Creating and exporting segments
  override: true
  description:
---

Using the information stored in your [contact lists](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/contacts.html), you can filter the data to create segments. Segmenting contacts using different conditions allows you to create marketing campaigns that directly addresses the wants and needs of a particular audience. You can create a segment that pulls from ALL CONTACTS or from a specific existing list. [Custom fields](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/custom_fields.html) allow you to use unique information to identify contacts for different segments.

Segments are dynamically updated over time as you add contacts who meet the criteria of your segment, or as the traits of your contacts change. For example, a segment with the criteria ”opened an email within 30 days” will evolve as contacts engage (or don’t engage) with your email. 

{% anchor h2 %}
Creating a Segment
{% endanchor %}

You can create a new segment with multiple conditions based on the information you have stored about your contacts. This
includes email, first_name, last_name, and all of the custom fields you have created prior to making this segment.

{% info %}
You can create up to 400 segments.
{% endinfo %}

*To create a segment:*

1. Navigate to **Marketing** and then select **Contacts**.
1. Click **Create Segment**. 
1. Choose **Segment all contacts** or **Segment an exisiting list**.
1. Enter a *Segment Name*.
1. If you chose to segment an existing list, select a list from the *Select List to Segment* drop-down. 
1. From the *Select Condition* drop-down choose a desired condition or custom field.
1. From *Select Criteria* drop-dwn choose from a list of available operators based on the chosen condition.

{% info %}
The operator tells the segment *how* to apply the condition.
{% endinfo %}

Depending on which condition is selected, the operators you can choose from differ. The operators assigned to custom fields will depend on the field type (Text, Date, or Number).  For example, a condition labled "Number” will show `GREATER THAN`, `LESS THAN`, and `EQUALS` as options whereas a “Text” field will show `IS` and `IS NOT` as options.

<style type="text/css">
.tg  {border-collapse:collapse;border-spacing:0;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
.tg .tg-s6z2{text-align:center}
.tg .tg-e3zv{font-weight:bold}
.tg .tg-yw4l{vertical-align:top}
</style>
<table class="tg">
  <tr>
    <th class="tg-e3zv">Operator</th>
    <th class="tg-e3zv">Description</th>
  </tr>
  <tr>
    <td class="tg-s6z2">is</td>
    <td class="tg-031e">data matches the text input exactly</td>
  </tr>
  <tr>
    <td class="tg-031e">is not</td>
    <td class="tg-031e">the data does not match the text input exactly</td>
  </tr>
  <tr>
    <td class="tg-031e">contains word</td>
    <td class="tg-031e">data includes the text input</td>
  </tr>
  <tr>
    <td class="tg-031e">is before</td>
    <td class="tg-031e">the date of the event is before the date selected</td>
  </tr>
  <tr>
    <td class="tg-yw4l">is after</td>
    <td class="tg-yw4l">the date of the event is after the date selected</td>
  </tr>
  <tr>
    <td class="tg-yw4l">is within</td>
    <td class="tg-yw4l">the date of the event is within a selected date range</td>
  </tr>
  <tr>
    <td class="tg-yw4l">opened</td>
    <td class="tg-yw4l">the contact opened an email from a campaign</td>
  </tr>
  <tr>
    <td class="tg-yw4l">not opened</td>
    <td class="tg-yw4l">the contact did not open an email from a campaign</td>
  </tr>
  <tr>
    <td class="tg-yw4l">clicked</td>
    <td class="tg-yw4l">the contact clicked a link within a campaign</td>
  </tr>
  <tr>
    <td class="tg-yw4l">not clicked</td>
    <td class="tg-yw4l">the contact did not click a link within a campaign</td>
  </tr>
</table>

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 Condition and the Operator, you can layer additional conditions in the segment to narrow the results to a more targeted audience. 
 
{% info %}
You can add up to 15 different conditions per segment.
{% endinfo %}


{% anchor h3 %}
Exporting a Segment
{% endanchor %}

*To export a Segment:*

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

This triggers SendGrid to send an email to the primary email address on the account that includes a link to
download the CSV of all the contacts in the list and their associated custom field values.

{% info %}
The download link for your CSV export will be valid for 24 hours.
{% endinfo %}


{% anchor h3 %}
Additional Resources
{% endanchor h3 %}

- [Contacts](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/contacts.html) 
- [Custom Fields](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/custom_fields.html)


{'fraction_non_alphanumeric': 0.09009430286026031, 'fraction_numerical': 0.013015353440885356, 'mean_word_length': 4.293729372937293, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 79, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3512520', 'n_tokens_mistral': 3812, 'n_tokens_neox': 3553, 'n_words': 1797}