Handling of duplicates on server

Hi community,

I have a specific challenge with handling purchase events from different sources (via webhook and data tag). My goal is to ensure that each purchase is sent only once.

To address this, I have been testing the Stape Store to keep track of transaction IDs. Despite not having any duplicates in the store, I am still unable to configure the trigger to prevent sending purchases if a transaction ID already exists.

Could you help me configure the trigger correctly to achieve this?

hey @DigitalPartner so your trigger should reference a lookup variable that searches for that transaction_id in the store. If it finds nothing (will return undefined I believe) - means there’s no such transaction in the store and you’re good to go, if it does find something - means you’ve already reported this purchase.

let me know if this makes sense

Yes, it does make sense. However, then after the task is to write the new transaction ID to the store. How do I do that? When I set the Stape Store tag on the same trigger, then the lookup variable always finds the new transactional_id in the store.

well, blunt but efficient sort of way would be to generate an extra request, so essentially send a request to yourself with a custom event name, trigger write tag on it. And on purchase event just keep the lookup.

it’s purchases we talk about so amount of extra requests is negligible.