Build a dynamic segment
In this exercise, we will create a segment for customers who have bought the same product twice within 30 days. Dynamic segments allow you to scale your segmentation by using fields as variables.
-
Go to Segments in the left navigation
-
Select the Create segment button
-
Select the Events tab
-
Filter the list to
purchases
-
Drag the Purchases event type onto the canvas two separate times
-
Select the clock icon in between the two Purchases events and choose “within 30 days”
-
Confirm that your segment definition at this point reads “Include audience who have at least 1 Purchases event then within 30 days have at least 1 Purchases event”
-
Now change the event filter to
sku
-
Drag the SKU field to the second purchase event
-
Now clear the event filter
-
You should see in the Browse Variables section, there are folders for the two purchase events. Click to explore Purchases 1
-
Drill down into the Product list items folder, select the SKU field, and drag it to the right of the equals operand. When you are hovering over the area, drop it in the “Add to compare operands” section
-
Name your segment
Bought same product within 30 days
-
Confirm that your audience definition is “Include audience who have at least 1 Purchases event then within 30 days have at least 1 Purchases event where ((SKU equals Purchases1 SKU))”
-
Select the Save button
Build a multi-entity segment
Remember how we created the relationship between the Luma Offline Purchase Events Schema
and the Luma Product Catalog Schema
in earlier lessons? We did that so we could use the relationship in our schema using multi-entity segmentation.
With the advanced multi-entity segmentation feature, you can create segments using multiple XDM classes to extend your schemas. As a result, the segment builder can access additional fields as if they were native to the profile data store
You will create the next segment by applying the relationship you built between your Luma Product Catalog Schema
and your Luma Offline Purchase Events Schema
.
-
Go to Segments in the left navigation
-
Select the Create segment button
-
Select the Events tab
-
Filter the list to
purchases
-
Drag the Purchases event type onto the canvas
-
Select the clock dropdown above the event and choose in last 30 days
-
Filter the Events list to
category
and then drag the Product Category field onto Purchases -
Change the operator to starts with and enter
men
into the text box -
As the Name, enter
Purchased a Men's product in the last 30 days
-
Confirm the audience definition
(Include audience who have at least 1 Purchases event where ((Product Category starts with men)) ) and occurs in last 30 day(s)
-
Select the Save button