Refer to segmentations in expressions
In an expression, you can include segmentations that consist of several subgroups and conditions to receive the subsegmentation a customer belongs to. You can later use this expression in the dynamic content to display the specific content depending on the expression result.
Prerequisites
- Implement tracking code on your website.
Process
In this use case, you will go through the following steps:
- Create an aggregate that calculates the number of all transactions each customer has made.
- Create a segmentation that will divide the customers into three groups.
- Create an expression that includes in its formula only the segmentation you created in the previous part of the process.
Create an aggregate
As the first part of the process, create an aggregate that calculates the number of all transactions each customer has made.
-
Go to Analytics > Aggregates > Create aggregate.
-
As the aggregate type, select Profile.
-
Enter the title of the aggregate.
-
Click Analyze profiles by and select Count.
-
From the Choose event dropdown list, select transaction.charge.
-
In the date range, select Lifetime.
-
Save the aggregate.
Create a segmentation
In this part of the process, create a segmentation that will divide the customers into three groups:
- Customers who have made more than 5 transactions.
- Customers who have made between 3 and 5 transactions.
- Customers who have made less than 3 transactions.
The subsegments (groups) are built on the basis of the aggregate you created in the first part of the procedure.
Create the first subsegmentation
Create a subsegmentation that includes only customers who have made more than 5 transactions.
- Go to Analytics > Segmentations > New segmentation.
- Enter the name of the segmentation.
- Optionally, switch the Show in profile card toggle on.
- Enter the name of the subsegmentation.
- From the Choose filter dropdown list, select the aggregate you created.
- As the logical operator, select More than.
- Next to the logical operator, in the text field enter
5
.
Create the second subsegmentation
Create a subsegmentation that includes only customers who have made between 3 and 5 transactions.
- Under the main title of the segmentation, click the icon.
- Enter the name of the subsegmentation.
- From the Choose filter dropdown list, select the aggregate you created.
- As the logical operator, select Less or equal to.
- Next to the logical operator, in the text field, enter
5
. - Click Choose filter.
- From the dropdown list, select the aggregate you created.
- As the logical operator, select More or equal to.
- Next to the logical operator, in the text field, enter
3
. - Join the two conditions by selecting AND.
Create the third subsegmentation
Create a subsegmentation that includes only customers who have made less than 3 transactions.
-
Under the main title of the segmentation, click the icon.
-
Enter the name of the subsegmentation.
-
From the Choose filter dropdown list, select the aggregate you created.
-
As the logical operator, select Less than.
-
Next to the logical operator, in the text field enter
3
. -
Save the segmentation.
Create an expression
In this part of the process, create an expression that includes in its formula only the segmentation you created in the previous part of the process.
-
Go to Analytics > Expressions > New expression.
-
Enter the name of the expression.
-
Leave the Expression option at default (Attribute).
-
Optionally, switch the Show in profile card toggle on.
-
Click the Select button.
-
From the dropdown list, select Customer.
-
Click the button that appeared on the dashboard.
-
On the Choose attribute dropdown list, use the search box to find the segmentation you created.
-
Save the expression.
What’s next
You can preview the results in several ways:
-
Expression preview
The first way to check the results of the expression is the preview of the expression. In the search box, type the ID of the customer (for example, an email address), and you will get the results of the expression for the individual customer. -
Customer’s profile
If you enabled Show in profile card option for the segmentation and expression, you can see them listed on a customer’s profile.
- If the customer belongs to the segmentation, its name is listed on the segmentation list.
- The expression shows the subsegmentation to which the customer belongs.
- Analytical dashboard
You can create an analytical dashboard and add the expression to the dashboard. In the Dynamic key field, enter the ID of the customer for which you want to see the result.
Check the use case set up on the Synerise Demo workspace
Check the aggregate that returns the number of transactions, segmentation that groups customers according to the number of transactions and the expression that returns the segment to which a customer belongs in our Synerise Demo workspace.
If you don’t have access to the Synerise Demo workspace, please leave your contact details in this form, and our representative will contact you shortly.