Event-Based Segmentation
What is Event-Based Segmentation?
Event-Based Segmentation allows you to create event-based or object-based segments. By defining a source of Contact Event/Object Data users will have the ability to create segments that identify target demographics via custom aggregations of these events or objects from within Segment Builder.
This segmentation workflow will allow you to drill down into specific details of a particular event, such as a specific order's products or value. These segments can use both event record data and regular contact properties.
The following guide aims to help you understand the different parts involved in constructing an event-based condition in a segment.
How to Build a Segment using Events or Objects
There are 3 components to event or object-based segments in Simon.
- Aggregates - These are operations that can be taken on integer fields or to count the number of times an event has occurred for a user. Options include:
- Number of - used for counting the number of records for a given user, equivalent to a SQL
COUNT
- Average of - used for fields defined as an integer (i.e. purchase value), equivalent to SQL
AVG
- Sum of - used for fields defined as an integer (i.e. purchase value), equivalent to SQL
SUM
- Number of - used for counting the number of records for a given user, equivalent to a SQL
- Time - A timestamp clause that defines when the event has occurred. This condition is required for event record types, but not for objects. Timestamps can also be used as additional event properties below, though these will be evaluated alongside the any other event properties with the chosen AND/OR operator.
- Event Properties - Any additional fields about the event to filter on (i.e. campaign name, product name, store type).
Journey Events
Looking to segment based on a Journey event? You can choose one of these events from the event filer drop-down:
- Journey Entry
- Journey Exit
- Journey Action
- Journey Experiment Variant Assignment
Understanding Segmentation Logic
Event-Based Segment
SELECT count(user_id) as event_count
FROM emails_clicked
WHERE timestamp > 30 days ago
GROUP BY user_id
HAVING count(*) >= 1
Event-Based Segment with a Filter
SELECT count(user_id) as contact_count
FROM emails_clicked
WHERE timestamp > 30 days ago
AND campaign_name = "Significant Sale"
GROUP BY user_id
HAVING count(*) >= 1
Event-Based Segment with Multiple Filters
SELECT count(user_id) as contact_count
FROM purchases
WHERE timestamp > 30 days ago
AND (
product_name = "Aero Daily Fitness Tee L-Black"
AND store_type = "Web"
)
GROUP BY user_id
HAVING count(*) >= 1
Event-Based Segment with Additional Timestamp Filters
SELECT count(user_id) as contact_count
FROM purchases
WHERE created_date > 30 days ago
AND (
expected_delivery_date = 1 day from now
AND skus_ordered LIKE "%MH01-XS-Orange%"
)
GROUP BY user_id
HAVING COUNT(*) >= 1
Updated about 1 year ago