

# Set up customer segments in Amazon Connect Customer Profiles
Set up customer segments

 A *customer segment* is a group of customer profiles that share certain attributes. For example, a customer segment might contain all of your customers who live in a particular city, or all customers who are frequent callers and whose average spend is more than 500 dollars. With Amazon Connect Outbound campaigns, you can send campaigns to a customer segment. 

 Customer segments are dynamically evaluated based on attributes that you define, and can change over time when the value of the attributes change. For example, if you add new profiles to Customer Profiles domain, or if you modify or delete existing profiles, the number of profiles in that customer segment may increase or decrease. For more information about creating a customer segment, see [Build customer segments in Amazon Connect](customer-segments-building-segments.md). 

As a prerequisite to building segments in Amazon Connect, your administrator must setup your domain in the AWS Management Console and configure integrations to bring profile, order, asset, and/or case data into Customer Profiles. For more information, see [Enable Customer Profiles for your Amazon Connect instance](enable-customer-profiles.md). Enabling data integrations will let continue to generate your dynamic segments based on new data coming to your domain

Customer segments only contain customer profiles in your Amazon Connect Customer Profiles domain. Customer Profiles can be ingested from S3 or external applications, or created through Agent App, Contact Flows, or API. For more information about customer profiles, see [What is a customer profile in Amazon Connect?](customer-profiles-what-data.md).

**Topics**
+ [Build customer segments](customer-segments-building-segments.md)
+ [Manage segments](customer-segments-managing-segments.md)
+ [Create segments from imported files](customer-segments-imported-files.md)
+ [Export segments to a CSV file](customer-segments-exporting-segments.md)
+ [Use the segment AI assistant](customer-segments-ai-assistant.md)
+ [Troubleshooting](customer-segments-troubleshooting.md)

# Build customer segments in Amazon Connect
Build customer segments

**Note**  
**Segmentation powered by SQL (Beta) requires Data store to be turned on. Please visit Customer Profiles home page screen and enable Data store from the top blue banner**

**Note**  
To navigate to the segmentation builder experience in the Amazon Connect admin website, you need security profiles permissions for this feature. For more information, see [Assign security profile permissions to manage customer segments](security-profile-customer-profile-segmentation.md).
Before building segments, we recommend your Customer Profiles domain setup data integrations to populate profiles in your Customer Profiles Domain. For more information on how to configure data integrations with Customer Profiles, see [Integrate external applications with Amazon Connect Customer Profiles](integrate-external-apps-customer-profiles.md).
Segments can include events you captured using Calculated Attributes. For more information on how to configure custom Calculated Attributes and review the default Calculated Attributes Customer Profiles offers, see [Set up calculated attributes in Amazon Connect Customer Profiles](customerprofiles-calculated-attributes.md).

Amazon Connect provides two ways to build customer segments: 1/ Define segments through Spark SQL (Beta; requires Data store to be enabled); 2/ Define segments through audience groups and filters (Classic Segmentation). For both, you can use natural language prompts via Generative AI-powered Segment AI assistant. If you define segments in one of the ways, you move that segment to the other and would have to start again.

## Classic segmentation with audience groups and filters


 When you create a customer segment, you choose starting audiences and refine that audiences by choosing the filters that define the segment. For example, you could create an audience group, then choose a filter of all customers who live in a specific country and who are frequent callers. Segments are recalculated on demand, such as during campaign execution, contact flow execution, and segment estimate or export. As a result, the size and membership of each segment changes over time. 

 Additionally, you can create a second audience group, and then create a relationship (AND, OR, or EXCLUDE) between the two audience groups to further narrow down, concatenate, or exclude customers from the first audience group. 

![\[Two audience groups.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-segments-building-segments-1.png)


## Audience groups
Audience groups

 When you create a customer segment, you create one or more audience groups. An audience group consists of these components: 

![\[A conceptual diagram that shows the components of audience groups.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-segments-audience-groups-1.png)

+  **Starting audiences**: The customer segments that define the initial user population. You can specify up to 5 starting audiences, or all of the profiles in your Customer Profiles domain. 
+  **Filter groups**: Categories of audience information that you apply on top of the starting audiences. You can add multiple groups of filters which are connected by OR relationships. 
+  **Filters**: Filters reduce the audience number that belong to the segment. You can add as many filters as you want in order to tailor the segment to your needs. 

 A customer segment has to have at least one audience group, but you can optionally create a second audience group, and then create a relationship (AND/OR/EXCLUDE) between the two audience groups. See [Step 5: Add the second audience group (optional)](#step-5-add-the-second-audience-group-optional) for more details about the relationship. 

## Creating a customer segment
Creating a customer segment

 The following steps describe creating and configuring a customer segment: 
+  Step 1: Build a new segment 
+  Step 2: Configure name and description 
+  Step 3: Choose the starting audiences to include in audience group 1 
+  Step 4: Choose and configure the filter groups (optional) 
+  Step 5: Add audience group 2 (optional) 
+  Step 6: Enable Sorting (optional) 

### Step 1: Build a new segment
Step 1: Build a new segment

1.  To create a segment, ensure that you have created security profiles permissions as a prerequisite. For more information, see [Assign security profile permissions to manage customer segments](security-profile-customer-profile-segmentation.md). In addition, to best visualize the membership of your segment, we recommend data ingestion prior to segment creation. To ingest profiles through S3 or external applications, see [Create and ingest customer data into Customer Profiles](customer-profiles-object-type-mappings.md) or [Integrate external applications with Amazon Connect Customer Profiles](integrate-external-apps-customer-profiles.md). 

1.  Choose **Create a segment** in the Customer segment table view.   
![\[The Create a segment button.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/step-1-build-a-new-segment-1.png)

### Step 2: Specify a name and description
Step 2: Specify a name and description
+  For **Name**, enter a name for the customer segment to make it easy to recognize later. 
**Note**  
The Amazon Connect admin website uses the entered name as the `DisplayName` of the segment, and generates an identifier based on it. The generated identifier is used as the `SegmentDefinitionName` when you access the segment by using Customer Profiles APIs.
+  For **Description**, optionally enter a description for the customer segment. 

![\[A Segment name section.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/step-2-configure-specify-name-and-description-1.png)


### Step 3: Choose the starting audiences to include in audience group 1
Step 3: Choose the starting audiences to include in audience group 1

 You'll first choose how you want to define the starting audience for the audience group. 

1.  Under **Audience group 1**, for the **Starting audience** dropdown list, select one or more segments to include in the audience group, or choose **All profiles from Customer Profiles**. 
**Note**  
 When you choose multiple segments as the starting audience, the segments are connected by `OR` relationships. For example, if you choose **Premium membership customers** and **Basic membership customers** segments as the starting audiences, all profiles who are in either of the segments will be the included.   
![\[A Starting audience dropdown list.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/step-3-choose-the-starting-audiences-to-include-in-audience-group-1.png)

1. To create a segment with ProfileType, start by using **All Accounts from Customer Profiles** as your initial audience. This approach allows you to filter account-based profiles effectively. It's important to note that unless you specify otherwise, the segmentation process will automatically export all profiles within the customer profiles domain. This default behavior ensures comprehensive coverage but can be adjusted to meet specific targeting needs.

   The following is an example of how a segment definition can be created (either account- or standard-profiles based):

   **Filters all account-based profiles (ProfileType=ACCOUNT\$1PROFILE)**  
![\[Filters all account-based profiles (ProfileType=ACCOUNT_PROFILE).\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/step-3-choose-the-starting-audiences-to-include-in-audience-group-1-5.png)
**Note**  
To create a segment only with sub-profiles, create a new audience that excludes account-based profiles. For example, profiles with `ProfileType` is PROFILE or where `ProfileType` is empty.  
![\[To create a segment only with sub-profiles, create a new audience that excludes account-based profiles.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/step-3-choose-the-starting-audiences-to-include-in-audience-group-1-6.png)

   **Sample Campaign that targets accounts to be reached out by using `Phone`**  
![\[Sample Campaign that targets accounts to be reached out by using Phone\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/step-3-choose-the-starting-audiences-to-include-in-audience-group-1-7.png)

   In this example, the campaign targets a single account with the following call sequence:

   1. First attempts to reach John (ID: 2)

   1. If John doesn't answer, then calls Sally (ID: 3) as a backup contact

1.  Once you choose a starting audience, the **Estimated audience** section updates to display the eligible profiles. Once you edit the audience groups, you can click **Refresh** button in the Estimated audience section to re-fetch the estimate.  
![\[An Estimated audience section.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/step-3-choose-the-starting-audiences-to-include-in-audience-group-2.png)

### Step 4: Choose and apply audience filters (optional)
Step 4: Choose and apply audience filters (optional)

 After you’ve chosen your starting audiences, you can further refine the audiences by applying conditional logic to attributes. Segments supports standard profile attributes, custom profile attributes, and calculated attributes.

![\[Audience filters.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/step-4-choose-and-apply-audience-filters-optional-1.png)


**To choose and configure the audience filters**

1.  For **Attribute**, you can choose an attribute of the following types

   1.  **Calculated attributes** - Filter the audience based on one of calculated attributes. 

      See [Set up calculated attributes in Amazon Connect Customer Profiles](customerprofiles-calculated-attributes.md) to learn about the default Calculated Attributes and how to configure custom Calculated Attributes.

   1.  **Standard attributes** - Filter the audience based on one of standard profile attributes. 

      See [Standard profile definition in the Amazon Connect Customer Profiles](standard-profile-definition.md) for the list of standard profile attributes.

   1.  **Custom attributes** - Filter the audience based on one of custom profile attributes. 
**Note**  
We store up to 1000 most recent profile attributes within the domain. If your domain contains a large amount of attributes the oldest attributes may not be displayed in this list.

1.  Choose the **Operator**. Operators determines the relationship of the attribute to a value you enter. The following describes the available operators. Available operators change based on the type of value of the attribute you selected. 

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/connect/latest/adminguide/customer-segments-building-segments.html)

**Note**  
Customer segments in the Amazon Connect admin website uses UTC timezone and a default time of 00:00:00 UTC for all time-based filters. You can filter on dates but times are recorded as the same value. If you enter a date of 2024-01-01, the console passes the time as 2024-01-01T00:00:00Z.

**Note**  
When you specify a filter for a calculated attribute, you can override the time period of the calculated attribute definition. For example, the filter `Frequent caller is true for the event time period of 60 days` will override the *Frequent caller* [Default calculated attributes in Amazon Connect Customer Profiles](customerprofiles-default-calculated-attributes.md) to evaluate the value within the past 60 days instead of the [time period configured in the calculated attribute definition](customerprofiles-calculated-attributes-apis.md). This override is specific to the segment, and does not affect the calculated attribute definition itself.  

![\[Attribute, Operator, and Value to be evaluated.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/step-4-choose-and-apply-audience-filters-optional-2.png)


1. Specify the Value. You can specify multiple values connected by `OR` relationships. For example, `Address.Country` is `USA` or `Mexico`. The value input shows suggestions in the dropdown for string operators based on the customer profiles stored in the domain.
**Note**  
Values are case-sensitive. For example, *Address.Country is US* returns different results than *Address.Country is us*.

1.  (Optional) To apply additional attributes to this filter group, choose **\$1 Filter**. To create another group of filters, choose **\$1 Group**. 

**Note**  
 When you have multiple filters in a filter group, the filters are connected by AND relationships. For example, a filter group containing 2 filters, “*Address.Country* is USA” and “*Customer’s average hold time* is more than 10 seconds”, the profiles whose *Address.Country* is USA **and** *average hold time* is more than 10 seconds will belong to the segment. 

 When you have multiple filter groups in an audience group, Customer segments in the Amazon Connect admin website use OR relationships to connect between the filter groups. 

![\[Two audience filters.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/step-4-choose-and-apply-audience-filters-optional-3.png)


1. When you’re finished setting up the audience group, choose **Create segment**. 

### Step 5: Add the second audience group (optional)
Step 5: Add the second audience group (optional)

 Optionally add the second audience group and define a relationship with audience group 1. When you create a customer segment by using the Amazon Connect admin website, you can have a maximum of two audience groups per segment. If you add a second audience group to your segment, you can choose one of two ways to specify how the two audience groups are connected: 
+  **AND relationship** — If you use AND relationship to connect two audiences, your segment contains all profiles who meet the filters of both Audience group 1 and Audience group 2. 
+  **OR relationship** — If you use OR relationship to connect two audiences, your segment contains all profiles who meet the filters of either Audience group 1 or Audience group 2. 
+  **EXCLUDE relationship** — If you use EXCLUDE relationship to connect two audiences, the segment will contain profiles in Audience group 1 excluding the profiles in Audience group 2. 

**To configure second audience group**

1.  Choose **AND**, **OR**, or **EXCLUDE** relationship after configuring Audience group 1.   
![\[The AND, OR, or EXCLUDE options.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/step-5-add-the-second-audience-group-optional-1.png)

1.  Choose the starting audience in Audience group 2. For reference, see [Step 3: Choose the starting audiences to include in audience group 1](#step-3-choose-the-starting-audiences-to-include-in-audience-group). 

1.  (Optional) Choose the filters by which you want to narrow down your segments. For reference, see [Step 4: Choose and apply audience filters (optional)](#step-4-choose-and-apply-audience-filters-optional) 

1.  When you finish setting up the segment, choose **Create segment**. Segment is created and you can now use the segment in outbound campaigns or flows.   
![\[A message that the segment was successfully created.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/step-5-add-the-second-audience-group-optional-2.png)

### Step 6: Enable Sorting (optional)
Step 6: Enable Sorting (optional)

 Optionally configure sorting for your segment results. Sorting allows you to control the order in which profiles appear in your segment output. You can sort by up to 10 attributes. Attributes are evaluated from top to bottom. When multiple profiles share the same value for an attribute, the next attribute in the list is used as a tiebreaker, and so on.

Outbound campaigns and journeys respect this sort order when executing, which means profiles are processed and dialed in the order defined by the segment. For more information about using sorted segments with outbound campaigns, see [Outbound campaign best practices](https://docs.aws.amazon.com/connect/latest/adminguide/outbound-campaign-best-practices.html). Sorting segments is useful when you want to:
+ Prioritize high-value customers by sorting on attributes such as lifetime value or account tier.
+ Contact customers with upcoming appointments first by sorting on appointment date.
+ Process time-sensitive communications in a specific order.

**Note**  
Segment sort order is respected only for voice campaigns and voice activities in journeys. Other communication channels process profiles in an unsorted order.

**To enable sorting**

1.  Enter the attribute name you want to sort by. You can use an attribute from either standard or calculated attributes. 

1.  Specify the sort order: choose either **Ascending** or **Descending**. 

1.  (Optional) Specify the data type by choosing **String**, **Numeric**, or **Date**. If you do not specify a type, it is automatically inferred based on sampled data. 

![\[The Enable Sorting configuration for segment results.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-enable-segment-sorting.png)


## Creating segments powered by Spark SQL


Segments powered by Spark SQL enables you to use complete Customer Profile data and expanded functionality to define segments. You can use standard profile object attributes and custom object attributes. You can also used SQL-based functionality such as joining standard and custom objects together to use data from various objects, filtering segments with statistics such as percentiles and standardizing date fields to make comparisons. 

You can start by entering in a natural language prompt into Segment Assistant AI. Segment AI assistant will define the segment including its translation into Spark SQL. Segment Assistant AI will provide the steps it took to define the segment and you can validate it matches what you were aiming to create. You can also view the SQL, the SQL steps in natural language and a AI-generated summary of the Spark SQL to further help validate. If you want to make changes, you can update your natural language prompt or make edits to the Spark SQL directly. 

You also have the option to create the Spark SQL segment directly.

Like Classic segmentation, segments powered by Spark SQL can be used in segment membership calls, Flow blocks, and Outbound Campaigns.

When you use a Spark SQL segment in a segment membership call, Flow block, or Outbound Campaign initiated by a customer event, it uses the last exported segment (segment snapshot). The segment snapshot used for membership expires 1 year after creation. If you receive a 4XX error, ensure you have exported the segment (segment snapshot).

Outbound campaigns initiated by a customer segment do not require you to export the segment (segment snapshot).

**Note**  
**SQL segmentation runs on Data store which has up to 10 years data. Classic segmentation uses latest data (data updated in past 3 years)**

### Step 1: Build a new segment


In the Segment AI assistant, select “How to create a segment” for more guidance on creating valuable segments or “I want to generate a segment” to enter a natural language prompt to create the segment. 

Alternatively, use SQL to define a new segment in the query editor. 

### Step 2: Specify a name and description


For Name, enter a name for the customer segment to make it easy to recognize later.

**Note**  
The Amazon Connect admin website uses the entered name as the `DisplayName` of the segment, and generates an identifier based on it. The generated identifier is used as the `SegmentDefinitionName` when you access the segment by using Customer Profiles APIs.

For Description, optionally enter a description for the customer segment.

### Step 3: Review and validate the segment


Review the data the Segment AI assistant used and the steps the AI model it took to generate your segment. You can also review the SQL it created to define the segment in the query editor. If it was not able to create the segment, address the feedback it provided to help it create an accurate segment. Once it has generated a segment, Customer Profiles will automatically create a segment estimate for you. 

If you want to make edits, you can provide a new prompt by clicking “New conversation” or create/edit SQL in the query editor.

If you are not using the Segment AI assistant, you can validate the query and create the estimate by clicking on the “Validate and estimate query” button below the query editor. 

**Note**  
Segments powered by Spark SQL will take time depending on the amount of profile data you use in the segment and the SQL used, similar to other query engines (e.g., multiple joins across objects usually take more time). 

### Step 4: Create segment


Once you have build a segment and are satisfied, select “Create segment” button on the top right. Once you have created the segment, you can select Actions - exporting to .csv, using the segment in Flows and using the segment in Outbound Campaigns.

**Note**  
If you use the segment in Outbound Campaigns or Flow blocks, it will check segment membership based on when the segment was last created. If you need real-time segment membership checks as the Flow or campaign is being executed, use Classic segmentation. 

# Manage customer segments in Amazon Connect
Manage segments

 You can use the Amazon Connect admin website to create, view, copy, and perform other management tasks for customer segments. If you open a customer segment to view its settings, you can also quickly create a campaign that uses the segment. For more information on creating segments, see [Build customer segments in Amazon Connect](customer-segments-building-segments.md) in the Amazon Connect Developer Guide. 

**To manage customer segments**

1.  On the **Customer segments** page, navigate to the segment that you want to manage, or choose an action. 

![\[The Customer segments page, a list of segments.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-segments-managing-segments-1.png)


1.  On the **Actions** menu, the following options are available: 

   1.  **View details** — Choose this option to show information about the customer segment, including the date and time when the segment was created, and the date and time when the segment was last updated. The Amazon Connect user needs the **CustomerProfiles.Segments.View** security profile permission to perform this action. 

   1.  **Duplicate** — Choose this option to create a new customer segment that's a copy of the selected segment. You can then modify any settings in the new segment, without changing the original segment. The Amazon Connect user needs the **CustomerProfiles.Segments.Create** security profile permission to perform this action. 

   1.  **Export CSV** — Choose this option to export the customer segment to a file on your computer. For more information, see [Export customer segments to a CSV file in Amazon Connect](customer-segments-exporting-segments.md). The Amazon Connect user needs the **CustomerProfiles.Segments.Export** security profile permission to perform this action. 

   1.  **Delete** — Choose this option to delete the customer segment permanently. You can't recover a segment after you delete it. The Amazon Connect user needs the **CustomerProfiles.Segments.Delete** security profile permission to perform this action. 

**Important**  
 If you delete a segment, any active campaigns that use the segment will fail. Similarly, any segments built on top of the segment will stop working. Before you delete a segment, it's a good idea to first verify that a segment isn't being used by any active campaigns or other segments. 

# Create segments from imported files in Amazon Connect
Create segments from imported files

**Note**  
To access the segmentation builder experience in the Amazon Connect admin website, ensure that the appropriate security profiles permissions are configured. For more information, see [Assign security profile permissions to manage customer segments](security-profile-customer-profile-segmentation.md).

Customer segment import uses a CSV file containing profile data to create new profiles or update existing ones, which are then grouped into a segment. The CSV file must be under 1GB in size and include valid headers that map to standard profile attributes.

The following steps describe creating and configuring an imported customer segment:

1. [Create a new segment](#create-new-segment)

1. [Upload CSV file](#upload-csv-file)

1. [Configure segment details](#configure-segment-details)

1. [Map customer attributes](#map-customer-attributes)

1. [Set profile expiry](#set-profile-expiry)

1. [Create and monitor segment import](#create-monitor-segment-import)

## Create a new segment
Create a new segment

1. To create a segment, ensure that you have created security profiles permissions as a prerequisite. For more information, see [Assign security profile permissions to manage customer segments](security-profile-customer-profile-segmentation.md).

1. In the Amazon Connect admin website, navigate to **Customer Profiles****Customer segments**

1. Choose **Create segment** and select **From file upload** from the dropdown

## Upload CSV file
Upload CSV file

Choose a CSV file by either:
+ Choosing **Choose file** and selecting your file.
+ Dragging and dropping your file into the upload area.

The file must be:
+ In CSV format
+ Under 1GB in size
+ Contain headers
+ UTF-8 encoded

## Configure segment details
Configure segment details

For **Name**, specify a recognizable identifier for your segment. This field is required.
+ Use only letters (a-z, A-Z), numbers (0-9), hyphens (-), or underscores (\$1)
+ Begin with a letter or number (not an underscore)
+ Maximum length of 255 characters

**Note**  
The Amazon Connect admin website uses this name as the `DisplayName` of the segment and generates a unique `SegmentDefinitionName` identifier. This identifier is used when accessing the segment through Amazon Connect Customer Profiles APIs.

For **Description**, (optional), add details about your segment:
+ Maximum length of 1000 characters

## Map customer attributes
Map customer attributes

Object type mapping defines how Customer Profiles processes your CSV data. This mapping:
+ Determines how CSV data populates standard profile objects.
+ Specifies which fields to index for profile assignment.

For more information about object type mapping, see [Create and ingest customer data into Customer Profiles](customer-profiles-object-type-mappings.md).

Choose one of these options to map your CSV columns to Customer Profiles attributes:

### Option 1: AI-powered mapping (Recommended)


1. Choose **Generate customer attributes**, then choose **Next**.

1. The system analyzes your CSV headers and suggests appropriate mappings to standard profile attributes.

1. Review the suggested mappings.

1. Optional: Customize the mappings:
   + Modify standard profile attribute mappings.
   + Add custom attributes using the format: `Attributes.attribute-name`.
   + Update the unique identifier.

### Option 2: Manual mapping


1. Map each CSV column header to a profile attribute:
   + Use standard profile attributes. For a complete list, see [Standard profile definition in the Amazon Connect Customer Profiles](standard-profile-definition.md).
   + Create custom attributes using the format: `Attributes.attribute-name`.
**Note**  
You can map up to 25 attributes.

1. Choose one mapped attribute as the customer identifier (unique key).

### Choose a customer identifier


After completing the mapping, choose one mapped attribute as the customer identifier. Amazon Connect Customer Profiles uses this identifier to:
+ Create new profiles or update existing ones.
+ Match incoming data with existing profiles.

**Note**  
Attribute mappings can be modified at any time during setup, whether using AI-powered or manual mapping.

## Set profile expiry
Set profile expiry

Specify when imported profiles expire:

1. Choose an expiry option:
   + Default: 14 days from import date
   + Custom: Select a date using the date picker

1. For custom expiry dates:
   + Minimum: 1 day after import
   + Maximum: 90 days after import

Customer Profiles removes expired profiles from the segment and the profiles domain.

**Note**  
Choose an expiry period that aligns with your data retention requirements. Consider whether the default 14-day period meets your business needs before selecting a custom date.

## Create and monitor segment import
Create and monitor segment import

**Create the segment**

1. Review your configuration.

1. Choose **Create segment**.

1. The system will:
   + Upload your CSV file.
   + Create/update profiles based on the data.
   + Group the profiles into a segment.
   + Show progress by using a notification banner.

Monitor import progress
+ View the import progress on the segment details page.
+ The notification banner shows that the import job is in progress.
+ The import job details table shows:
  + File name
  + Import job creation date
  + Import job completion date
  + Number of profiles processed
  + Number of successful imports
  + Number of failed imports
+ You can cancel the import while in progress.
+ The segment can be used in campaigns while the import job is still in progress.

**Note**  
Imported segments can be used like any other segment for outbound campaigns or exports once the import is complete. You can view the segment details, including import status and results, from the segment details page.

# Export customer segments to a CSV file in Amazon Connect
Export segments to a CSV file

 From the **Customer segments** page in the Amazon Connect admin website, you can export an existing segment to a file on your computer. When you do, Customer Profiles exports all of the profile attributes that's associated with the profiles in the customer segment to a CSV file. 

**To export a customer segment**

1.  On Customer segments page, choose **Export CSV** in the actions dropdown.

![\[The Customer segments page, the Export CSV option.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-segments-exporting-segments-1.png)


Alternatively, you can navigate to the **View details** page, and choose **Next actions**, **Download**.

![\[The segment details page for a segment, the Next actions option.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-segments-exporting-segments-2.png)


**Note**  
The Amazon Connect admin website supports exporting a customer segment that contains up to 350,000 profiles. If you need to export a segment that contains a large number of profiles, use the `CreateSegmentSnapshot` operation in Customer Profiles API. The `CreateSegmentSnapshot` operation supports exporting a segment in ORC, JSONL, and CSV files to an S3 bucket. Note that the API outputs a test file in addition to the exported segment in the bucket.

1. After the export job begins, keep the window or tab containing the download open until the process completes.

![\[A message that the segment is being exported.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-segments-exporting-segments-3.png)


1. After the export job completes, the Amazon Connect admin website automatically starts downloading the file. 

![\[A message that the segment has been successfully downloaded.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-segments-exporting-segments-4.png)


 The exported CSV file contains all [standard and customer profile attributes](https://docs.aws.amazon.com/connect/latest/adminguide/standard-profile-definition.html) populated across the exported profiles.

# Use the segment AI assistant in Amazon Connect
Use the segment AI assistant

 Amazon Connect Customer Profiles supports generative AI-powered segmentation, enabling non-technical business users to build audiences using natural language queries ([segment AI assistant](#generating-a-segment-by-prompt)), and to receive recommendations based on trends in the customer data ([inspiration cards for segment creation](#inspiration-cards-for-segment-creation)). These capabilities leverage advanced AI algorithms from [Amazon Bedrock](https://aws.amazon.com/bedrock/) that help you improve customer satisfaction and drive revenue through proactive and personalized outreach. For example, you can create a segment of customers who reached out to customer support frequently last week with personalized service offers. You can also identify customers whose total spending increased and offer personalized discounts, fostering loyalty and also driving growth. 

 The following benefits are added by incorporating generative AI into the segmentation workflow:
+  **Simplified segment creation**: Build complex customer segments using conversational language, making the process accessible to non-technical users and driving the efficiency. 
+  **Data-driven segment creation inspirations**: Receive AI-empowered segment inspirations based on trends in the customer data. 
+  **Enhanced personalization:** Easily identify and target specific customer groups for tailored communications and offers. 

 The following sections explain each feature, how to use them, and the benefits they provide to help you improve your customer segmentation efforts. 

**Note**  
To use the segment AI assistant, users will need the permission for segment creation **CustomerProfiles.Segments.Create**. 
While these AI-powered tools offer valuable suggestions, it's important to review and adjust the recommended segments to ensure they align with the organization's specific business objectives and comply with its data usage policies. 

## Inspiration Cards for Segment Creation
Inspiration Cards for Segment Creation

Inspiration Cards are an AI-powered feature on the **Customer segments** page. They simplify and enhance the segment creation process. The following image shows an example of three inspiration cards. 

![\[An example of inspiration cards on the Customer segments page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/inspiration-cards-for-segment-creation-1.png)


These cards generate up to three categories of segment ideas each time, based on the Amazon Connect Customer Profile data to inspire and streamline your segment creation process.  

**Note**  
The trend data is based on event ingestion dates of default calculated attributes.

 **Key features** 
+  **Data-driven inspirations**: Each inspiration card presents a segment idea tailored to specific customer data and trends. 
+  Inspiration cards offer ideas across three business-focused themes: 
  +  **Promotion**: Ideas for targeting customers with specific promotional strategies. 
  +  **Retention**: Identify segments for customer retention efforts. 
  +  **Support**: Highlight customer groups that may need specialized attention for customer service. 
+  **Insight-based recommendations**: Leverage historical trends, data insights and generative AI to create meaningful, actionable insights. 

 **How to use inspiration cards** 

1.  Navigate to the **Customer segments** page. 

1.  Locate the inspiration cards section. It displays three segment suggestions. 

1.  Review each card to understand the proposed segment and its potential applications. 

1.  When you find a card you want to use, choose **Get started** on that card. 

1.  Choose **Explore more** to generate additional inspiration cards. These can offer fresh segment ideas based on your Amazon Connect Customer Profiles data. 

1.  When you choose **Get started**, you are automatically directed to the **Create Segment** page. 

1.  Your selected segment idea is populated in the segment builder, ready for your review and refinement. 

## Generate a segment by using natural language prompts
Generate a segment by prompt

 The segment AI assistant offers a guided approach to creating segments using natural language prompts, which simplifies the process of creating complex segments, allowing you to describe your target audience in natural language and receive a structured, actionable segment definition. 

The following image shows an example of a segment AI assistant prompt.

![\[An example of segment AI assistant prompts.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/generating-a-segment-by-prompt-1.png)


 **To access this feature:** 

1.  Navigate to the** Customer segment** page, and then choose **Create segment**. 

1.  Locate the segment AI assistant panel on the right side of the page, as shown in the following image. 

![\[An example of the segment AI assistant panel on the right side of the page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/generating-a-segment-by-prompt-2.png)


 **Use the segment AI assistant** 

1.  The assistant guides users through a series of questions to understand segmentation needs, all interaction paths with the assistant lead to generating a prompt. 

1.  Users can provide a textual description of the desired segment. 

1.  The prompt action step offers sample prompts as references for writing detailed descriptions. 

1.  Based on your input, Amazon Connect generates a structured segment definition. 

1.  The generated segment definition is automatically applied to the segment builder. 

1.  You can further refine the generated segment using the standard segment builder tools. Modifying the filters on the segment builder overwrites the existing conditions previously generated.  

1.  After reviewing the generated segment and making any necessary adjustments, you can finalize the process by choosing **Create segment**. This action saves your segment and makes it available for use in your campaigns. 

 **Best practices** 

 As you use the segment AI assistant, keep the following best practices in mind: 
+  Write specific descriptions. Segment AI assistant generates more accurate conditions when you use the names of existing attributes. 
+  Ensure that all attributes you reference exist in your domain. 
+  Start with simple prompts and try different prompts. If you don't receive what you want on the first try, rewrite your prompt. Submitting a new prompt replaces existing conditions, or by choosing **New conversation**. 
+  Allocate time for segment refinement and validation on the segment builder to ensure segments accurately reflect your actual data values. 

**Note**  
The segment AI assistant is designed to work with general descriptors and criteria. Always adhere to data protection regulations and company policies when describing segments. Ensure that your prompts and descriptions do not contain any sensitive or personal information.  

## Provide feedback on generated segments
Provide feedback on generated segments

 After a segment is generated, users are encouraged to evaluate the feature's performance and provide feedback. This feedback mechanism helps improve the segment generation process and ensures it meets business needs effectively. The following image shows a feedback page.

![\[An example of a message that your feedback has been recorded.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/providing-feedback-on-generated-segments-1.png)


 The feedback process consists of two stages: 

1.  **Initial reaction**: In the bottom right corner of the alert section, you'll find thumbs up and thumbs down icons. Click on either of these to indicate your general satisfaction with the generated segment. 

1.  **Additional feedback**: After selecting either the thumbs up or thumbs down icon, you are presented with an option to provide more detailed feedback. This takes the form of a text input field where you can leave free-form comments. 

 We encourage you to use both the quick reaction (thumbs up/down) and the text input for a comprehensive evaluation, provide specific examples or use cases when applicable, focus on how the generated segment aligns with business objectives, and suggest improvements or additional features that would enhance the segment generation process. 

 Suggest improvements or additional features that would enhance the segment generation process. 

 By actively participating in the feedback process, users contribute to the continuous improvement of the segment generation feature, ultimately leading to more effective customer segmentation and targeted marketing strategies. 

## Error handling
Error handling

When using the segment AI assistant to generate customer segments, you may occasionally encounter an error message stating: **We can't process your request right now.** This error can occur even after providing a valid prompt for segment creation.

The following image shows an example of this error message.

![\[An example of an error message that Amazon Connect can't process your request.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-segments-ai-error-handling-1.png)


 Use the following steps help you understand and troubleshoot this error.

 **Possible causes:** 
+  **High system load**: The segment AI assistant may be experiencing high demand or processing multiple requests simultaneously. 
+  **Temporary service disruption**: There could be a brief interruption in the service's ability to process new segment requests. 
+  **Complex query**: The system might need more time to process particularly complex or resource-intensive segment queries. 

 **What to do:** 
+  **Wait and retry**: The error message suggests waiting a few minutes before trying again. This allows time for the system to resolve any temporary issues. 
+  **Create a segment manually**: If you need the segment immediately, you can opt to create it manually using the segment builder 

 **How to retry:** 

1.  Wait for a few minutes. 

1.  Choose **New conversation** at the bottom of the chat interface. 

1.  Start a new conversation and re-enter your segment creation prompt. 

 **Best practices** 
+  If the error persists after multiple attempts, consider simplifying your segment criteria or breaking it down into smaller, more manageable requests. 
+  Try to avoid making repeated requests in quick succession, as this may contribute to system overload. 
+  If the issue continues, reach out to customer support for further assistance. 

 Remember, this error is typically temporary, and following the provided instructions should allow you to successfully create your desired segment. 

## Known limitations
Known limitations

 Understanding the data processing lifecycle is crucial for effective use of the segment AI assistant. This section outlines what business users can expect during different phases of data integration and how it affects segment suggestions. 

 **Data processing and quality impact:** Segment AI assistant evolves through two main phases: initial data ingestion and post-processing. During initial ingestion, the system may not fully utilize actual attribute values, relying more on prompt interpretation. For example, a prompt for *VIP customers* might suggest a *VIP* segment instead of using the existing *Gold* tier from your data. After complete processing, the system leverages actual attribute values, resulting in more accurate segment creation, reduces reliance on prompt interpretation and improves overall segmentation quality. 

**Note**  
Allow sufficient time for complete data processing before relying on advanced features. Regularly update customer profile data. Segment accuracy depends on the completeness and recency of customer data in Amazon Connect Customer Profiles. The system flags any missing attributes in its responses. 

 **System performance: **During high-volume periods, expect potential delays in segment generation. The system is optimized for typical workloads, but businesses with extensive segmentation needs may need to adjust their processes accordingly. 

 **Attribute availability**: The quality of the generated segments is dependent on the customer data available in Amazon Connect Customer Profiles. The more comprehensive and up-to-date the customer profile data, the more accurate the system can be in interpreting prompts and defining relevant segments. If there is an attribute that does not exist, we will return a message with the missing attribute.  

 **Prompt complexity**: For very complex or nuanced segment definitions, the natural language processing may have limitations. Customers should start with relatively straightforward prompts and gradually increase the complexity as they gain experience with the feature. 

 **Segment refinement**: Although the system-generated segments are a great starting point, customers may still want to review and refine the details to ensure the segment aligns perfectly with their business objectives. The segmentation interface allows for full customization after the initial generation. 

 **Performance and scaling**: Under high concurrency, there may be some latency in the segment generation process as the language model needs to process each prompt. The system is designed to handle typical segmentation workloads, but customers with extremely high segmentation demands may need to adjust their workflows accordingly 

# Troubleshooting customer segments in Amazon Connect
Troubleshooting

## The Customer segments option doesn't appear in the left navigation panel
The Customer segments option doesn't appear in the left navigation panel

 If a **Customer segments** option does not exist in Amazon Connect admin website left navigation panel, check if the user's security profiles has the **Customer segment - View** permission. For more information, see [Assign security profile permissions to manage customer segments](security-profile-customer-profile-segmentation.md). After the permission is updated, refresh the Amazon Connect admin website page to reflect the change.

## Export CSV button not available, or export job timed out
Export CSV button not available, or export job timed out

 Exporting a segment that contains more than 350,000 profiles is not supported in the Amazon Connect admin website. Alternatively, we recommend exporting this type of segment to an Amazon S3 bucket using the `CreateSegmentSnapshot` API through the command line reference (CLI) or SDK. 

## Error: You reached the limit of 60 unique attributes
Error: You reached the limit of 60 unique attributes

 This error occurs when the number of unique attributes in the segment definition exceeds the quota. The number of unique attributes are counted including the starting audiences recursively. 

**Solutions**
+  Reduce the number of unique attributes by removing audience filters in the segment definition, or removing starting audiences that contains audience filters. 
+  [Request a quota increase](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) for the service quotas - Maximum number of unique attributes in segment  

 For more about default service quota, see [Amazon Connect Customer Profiles service quotas](https://docs.aws.amazon.com/general/latest/gr/connect_region.html#limits_customer_profiles). 

## Error: You reached the limit of 10 unique calculated attributes
Error: You reached the limit of 10 unique calculated attributes

 This error occurs when the number of unique calculated attributes in the segment definition exceeds the quota. The number of unique calculated attributes are counted including the starting audiences recursively. 

**Solutions**
+  Reduce the number of unique calculated attributes by removing audience filters on calculated attributes in the segment definition, or removing starting audiences that contains audience filters on calculated attributes. 
+  [Request a quota increase](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) for the service quotas - Maximum number of unique calculated attributes in segment. 

 For more about default service quota, see [Amazon Connect Customer Profiles service quotas](https://docs.aws.amazon.com/general/latest/gr/connect_region.html#limits_customer_profiles). 

## Error: You reached the limit of 5 depth of starting audiences
Error: You reached the limit of 5 depth of starting audiences

This error occurs when the depth of starting audiences exceeds the quota. The depth is counted recursively for all of the starting audiences in your audience group. For example, if you select a segment "Eligible rental upgrade" as a starting audience, and the segment "Eligible rental upgrade" has another segment as a starting audience, the depth will be 2.

**Solution**
+ Remove one or more starting audiences in your audience group that contains deeply nested starting audiences.

For more about default service quotas, see [Amazon Connect Customer Profiles service quotas](https://docs.aws.amazon.com/general/latest/gr/connect_region.html#limits_customer_profiles).