Voucher assignment based on average basket value
Most marketers know that vouchers in line with your customers’ shopping habits are one of the best ways to turn a visit into a sale. Sending an email with a relevant discount coupon to customers who have not purchased in a while will be great to re-engage them. You can personalise the communication and drive extra revenue for your business by grouping your customers by their average order value and offering them a better-tailored offer. Directing vouchers to the right audience at the right time will be more effective than sending irrelevant offers to all your customers. In this use case, you will create an automation that sends an email communication with a dedicated voucher code to a specific segment of customers with two or more transactions, depending on their average order value (AOV). The workflow is triggered when customers’s session on the site ends, and will only continue for those customers who meet all the conditions defined in the segmentation and have not made any purchase in the last 30 days.
![The promotional graphic for the use case](/use-cases/all-cases/_gfx/vouchers-depending-on-aov-main.png)
Prerequisites
- Implement a tracking code.
- Configure email account.
- Implement transaction events using SDK or API.
- Create two different voucher pools. One will be used for customers whose AOV less than 200 PL and one for those with AOV greater than or equal to 200 PLN.
Process
In this use case, you will go through the following steps:
- Create an aggregate for calculating AOV.
- Create an aggregate for counting transactions.
- Create a segmentation based on the aggregates to set an audience for use in communication.
- Create an expression that will be used in an e-mail template to check which segment the customer is in.
- Create an email template with jinjava code that inserts a voucher code depending on the customer’s segment.
- Create a workflow that will send emails with vouchers to a specific segment of customers.
Create an aggregate for calculating AOV
In this part of the process, create an aggregate that returns AOV from transaction.charge
event.
- Go to
Analytics > Aggregates > New aggregate.
- Enter the name of the aggregate.
- As the type of the aggregate, select Average.
- From the Choose event dropdown list, select the
transaction.charge
event. - As the event parameter, select $totalAmount.
- Define the period which the aggregate will analyze. In this use case, it is Lifetime.
- Save the aggregate.
![The view of the configuration of the avarage order value aggregate](/use-cases/all-cases/_gfx/aov_agg1.png)
Create an aggregate for counting transactions
In this part of the process, create an aggregate that returns number of transactions.
- Go to
Analytics > Aggregates > New aggregate.
- Enter the name of the aggregate.
- As the type of the aggregate, select Count.
- From the Choose event dropdown list, select the
transaction.charge
event. - Define the period which the aggregate will analyze. In this use case, it is Lifetime.
- Save the aggregate.
![The view of the configuration of the aggregate returning number of transactions](/use-cases/all-cases/_gfx/aov_agg2.png)
Create a segmentation
In this part of the process, create a segmentation that contains two customer target groups who made at least two transactions. First for customers with AOV less than 200 PLN and second for customers with AOV equal or greater than 200 PLN.
The names of the segments will be used as variables later, so enter them as exactly as instructed.
-
Go to
Analytics > Segmentations > New segmentation.
-
Enter the name of segmentation.
-
Rename Segment A to
AOV < 200 PLN
-
From the Has property dropdown list, select the aggregate for AOV you created in the previous step.
-
As the operator, choose Less than for number.
-
In the text field, enter
200
-
From the Has property dropdown list, select the aggregate for counting transactions you created in the previous step.
-
As the operator, choose More or equal to for number.
-
In the text field, enter
2
Configuration of the segmentation for AOV less than 200 PLN -
Click Add segment next to the first one. Name the new segment
AOV >= 200 PLN
-
From the Has property dropdown list, select the aggregate for AOV you created in the previous step.
-
As the operator, choose More or equal to for number.
-
In the text field, enter
200
-
From the Has property dropdown list, select the aggregate for counting transactions you created in the previous step.
-
As an operator, choose More or equal to for number.
-
In the text field, enter
2
-
Save the segmentation.
![The view of the configuration of the segmentation for AOV more or equal to 200 PLN](/use-cases/all-cases/_gfx/aov_seg2.png)
Create an expression
In this part of the process, create an expression which will be used to return the customer’s segment in the segmentation created in the previous step. It will be used later in the email template and will allow us to target vouchers appropriately - to the right group of customers.
- Go to
Analytics > Expressions > New expression.
- Enter a meaningful name of the expression.
- Leave the expression type at default (Attribute).
- Build the formula of the expression.
- Click the Select node.
- From the dropdown list, select Profile.
- Click the unnamed node.
- From the Choose attribute dropdown list, select the segmentaion created in the previous step.
- Save the expression.
![The view of the configuration of the expression for definig in which segment is the customer](/use-cases/all-cases/_gfx/aov_expression.png)
Create an email template
In this part of the process, create an email template with a Jinjava code which uses the results from the expression created in the previous part of the process to check the customer’s segment and assign a voucher code from the corresponding pool.
-
Go to
Communication > Email.
-
On the left pane, click Templates.
-
Select the wizard:
- Drag&drop builder - use ready-made components to build an email template.
- Code editor - use HTML, CSS and JS to build an email template from scratch.
-
Build a template.
-
Add the Jinjava code presented below.
This code includes a context of the node from the workflow you will create in the next part of the process. Thanks to this context, the latest results of the expression will be used in the email template to select the voucher pool corresponding to the customer’s segment. You can change the text of the messages in the code according to you business needs.- Replace the UUID after
expressionvar
with the ID of the expression you created earlier. - Replace the UUID in the first
voucher
tag with the ID of the voucher pool with vouchers for customers whose AOV is less than 200 PLN. - Replace the UUID in the second
voucher
tag with the ID of the voucher pool with vouchers for customers whose AOV is 200 PLN or more
Check the Jinjava code{% expressionvar 2bf51517-ae79-4bfb-bd37-153408c80bf5 %} {% set state = expression_result %} {% if state == 'AOV < 200 PLN' %} Buy discounted products from the online shop with an extra 10% discount! You can find your personal code below <p> {% voucher assign=false %} f017803f-4d5c-4192-aa3a-f845822490cb {% endvoucher %} {% elif state == 'AOV >= 200 PLN' %} Buy new collection products from the online shop with a 20% discount! You can find your personal code below. <p> {% voucher assign=false %} 8464b593-478c-412a-9dfb-0aab59f8ff5e {% endvoucher %} {% endif %} {% endexpressionvar %}
- Replace the UUID after
-
Save the template.
Create a workflow
In this part of the process, you will create the workflow which sends emails with vouchers to a specific segment of customers, triggered when they finish their session on the site. The voucher will be sent maximum once a month, to customers who didn’t make a purchase in the last 30 days.
- Go to
Automation > Workflows > New workflow.
- Enter the name of the workflow.
- Click Set capping and define the limit of workflows a profile can start:
- Set Limit to 1.
- Set Time to 30 days.
- Confirm by clicking Apply.
![The view of the configuration of the workflow capping](/use-cases/all-cases/_gfx/aov_capp.png)
Add the Profile Event node
- Click Add trigger.
- From the dropdown list, select Profile event.
- Click the node.
- From the Choose event dropdown list, select
session.end
. - Confirm by clicking Apply.
Add the Delay node
Add the Delay node to define the lag between the session.end
event and sending an email with voucher to specific segment of customers. In this example it is 1 hour.
- Click MATCHED.
- From the dropdown list, select Delay node.
- Click the node.
- Set Time of delay to 1 hour.
- Confirm by clicking Apply.
Add the Profile Filter node
- Click THEN.
- From the dropdown list, select Profile Filter node.
- Click the node.
- From the Choose filter dropdown list, select the expression created in the previous step.
- From the Choose operator dropdown list, select Is true.
- Add another condition by clicking the Choose filter dropdown list and selecting the
transaction.charge
event. - Click Profiles matching funnel and change it to Profiles not matching funnel.
- Click the calendar icon in the right lower corner to change the date range.
- In the Relative date range section, select Custom.
- Set to Last 30 days.
- Confirm by clicking Apply.
- Confirm by clicking Apply.
- At the NOT MATCHED path, add the End node.
![The view of the configuration of the Profile Filter node](/use-cases/all-cases/_gfx/aov_eventfilter.png)
Add the Send Email node
- Click THEN.
- From the dropdown list, select Send Email node.
- In the Sender details section, choose the email account from which the email is sent.
-
- In the Content section:
- Select the template that you prepared in the previous step.
- Add the subject of the email.
- You can define the UTM parameters in the UTM & URL parameters section.
- In the Additional parameters section, optionally describe the campaign with additional parameters.
- Confirm by clicking Apply.
- Click THEN.
- From the dropdown list, select End node.
- Click Save & Run.
![The view of the Automation](/use-cases/all-cases/_gfx/aov_workflow.png)
Check the use case set up on the Synerise Demo workspace
You can check the configuration of:
- Voucher pool for customers with AOV less than 200 PLN
- Voucher pool for customers with AOV more than or equal to 200 PLN
- Aggregate for AOV
- Aggregate for counting transactions
- Segmentation
- Expression
- Automation directly in 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.