Skip to main content

Create and add rules to a segment in Sitecore CDP

Abstract

How to create a segment and add rules (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:

  1. On the navigation menu, click Batch Segments. A list of segments displays.

  2. Click Create Segment. The Title of Segment window displays.

  3. Enter an intuitive name for the segment and click Create. The Build screen displays.

  4. 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:

    • Guest

    • Session

    • Event

    • Order

    • Order Item

      Note

      The entities that display reflect your organization's data dictionary in the data lake, and 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.

  5. To add a field or attribute to the rule, click + Add.

    Tip

    To see an instant number of guests that have a specific attribute, hover over the chart seg_cdp_charticon.png icon next to the attribute, as shown in the following screenshot.

    Viewing embedded analytics in batch segmentation.
  6. Click a comparator to use in the rule from the drop-down list, and enter or select the related value:

  7. To save the rule, click the check cdp_seg_bluecheck.png icon.

    Note

    It is best practice to calculate the audience size when you build your rule.

  8. To add another rule to the same filter group, click Add Rule to This Group, complete the additional fields that display, and click the check cdp_seg_bluecheck.png icon to enable the rule operator drop-down list.

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

      Note

      If 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:

  1. In the Build screen, to add a rule from a different filter group, click Add Filter Group and repeat steps 5-7 from the previous procedure.

  2. 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 the check cdp_seg_bluecheck.png icon.