In the Double opt-in use case, we send a confirmation email to the customer inbox to double check they are the owners of that email address.
In the step, where the confirmation email is sent and based on the click on this email we are tracking the consent through webhook or add event node, the click could be duplicated and will result in a duplicated consent event. The duplication of the click could be caused by user action or by the response of the inbox, bot traffic, server latency, etc.
Such duplication can cause trouble because we know that a lot of use cases are triggered on the consent event and if you are assigning vouchers based on the consent event, or sending some communication, most likely this action will be duplicated too.
Fortunately, we can prevent this by accounting for only one click from such duplicates. This will ensure that the following campaigns are not duplicated.
This is done in the scenario.
When there are two clicked events from the same customer, we need to tell the scenario to take only the last one into consideration, and we achieve it like this:
First, we create an aggregate for the last clicked campaign timestamp:
So after the campaign click is tracked and the flow is triggered, and the customer is going through, we check if the trigger event(event.timestamp) is equal to the last campaign clicked timestamp(aggregate):
The jinja used in the condition:
{% if event.timestamp == aggregates['aggregate_id'] %}
True
{% else %}
False
{% endif %}
If yes the customer is let through and if not he is stopped.
Then there is the creation of the consent event, and with this setup, we can achieve that although the campaign was clicked twice only one consent event is tracked:
Notes:
- The ID of the aggregate is present in the URL as it is in any other definition, campaign or analytic tool.
- When you are setting the trigger event in the scenario, please use at least 20/30 seconds delay on the node to ensure that the data are already tracked, processed and present in the application. The delay will also ensure that the filter will be able to check multiple events tracked during specified delay time in the trigger.