Create and add rules to a segment in Sitecore CDP
You can create a segment to use within Sitecore CDP or to interrogate your organization's data. After you create a segment, you must schedule the segment to be included in your organization's nightly segment build. You do not need to schedule the segment if you are just interrogating your organization's data.
Create a segment
To create a segment:
-
On the navigation menu, click Batch segments > Batch segments.
-
Click Create Segment.
-
In the Title of Segment dialog, enter an intuitive name for the segment and click Create.
-
In the segment builder, to view the available fields and attributes that you can add to your segment rule, click one of the following entities and the related entity type that displays in Segment rules:
-
Note
The entities that display depend on the data your organization has passed to Sitecore CDP using the Sitecore CDP APIs. For example, if your organization has not passed orders and order items to Sitecore CDP yet, you will not see the Order and Order Item entities.
-
To add a field or attribute to the rule, click + Add. To see an instant number of guests that have a specific attribute, hover over the chart
icon next to the attribute, as shown in the following screenshot.
WarningData availability in segments
Sitecore CDP runs a nightly processing service that provides the most recent guest data to segments. The service runs at 00:00 UTC. This means that any data used to create a segment is based on data up to the last time the service ran. For example, if you create a segment of customers with abandoned carts, Sitecore CDP will include customers with abandoned carts up to 00:00 UTC. Any customers with abandoned carts after this time will be available for segments when the service runs again at 00:00 UTC.
The daily processing service can also affect when certain values display in the segment builder for selection. For example, if you want to create a segment that uses a new event type named
ADD_TO_WISHLIST
, it won't display as a value for selection in the UI until you have at least one guest with anADD_TO_WISHLIST
event that was raised before the last processing service ran, 00:00 UTC. -
Click a comparator to use in the rule from the drop-down list. Comparators are based on the following data types:
-
Enter or select the related value from the drop-down list then click
to save the rule. The list includes values based on guest data from the last 24 hours of interaction. Data from ongoing guest interactions will display in the list after 24 hours.
-
To add another rule to the same filter group, click Add rule, complete the additional fields that display, and click
to enable the rule operator drop-down list.
NoteIt's best practice to calculate the audience size when you build your rule.
-
In the rule operator drop-down list, click the rule operator you want to use to join the two rules:
-
And - combines conditions in the same filter group. Guests must have all the conditions in the preceding and subsequent rules to be included in the segment.
-
Or - guests can have either of the conditions in the preceding or subsequent rules to be included in the segment.
NoteIf you are familiar with SQL and the Sitecore CDP data model, you can click Advanced Mode to write SQL queries to create a segment.
You can add segment rules from different filter groups or schedule the segment to be included in your organization's nightly segment build.
-
Add a segment rule from a different filter group
To add a rule from a different filter group:
-
In the segment builder, in Segment rules, click Add Filter Group and repeat steps 5-7 from the previous procedure.
-
In the Combine with next group drop-down list, click one of the following group operators:
-
And - combines conditions between filter groups. Guests must have all the conditions in the preceding and subsequent filter groups to be included in the segment.
-
Or - guests can have either of the conditions in the preceding or subsequent filter groups to be included in the segment.
-
Not - excludes guests from the segment that have the condition in the subsequent filter group.
-
You can continue to add rules to the current group, or add new filter groups, as required. Sitecore CDP automatically saves the segment each time you click .