Forum Discussion
Storing Event Data and Using It in a Decision Split - Canvas
Storing Event Data and Using It in a Decision Split
I'd like to know if it's possible to set up the following scenario in Canvas. I'm currently sending a custom event with a numeric value related to a purchase. My goal is to store that value so that when a second purchase happens, and the combined total exceeds $50, a Decision Split can send the user down a specific path.
For example:
If Derek makes a first purchase of $30 and then a second one of $30, the combined total would exceed $50, and he should go down one path. But if Lina makes a $10 purchase followed by another $10 purchase, she wouldn’t meet the threshold and should go down another path.
From what I understand, this seems difficult (if not impossible) to do, since Canvas doesn’t store the value of the first purchase while waiting for the second event to arrive.
3 Replies
- Manoj__Visionary
luis123her You can create a webhook campaign that listens for purchase events and continuously updates the value of a custom attribute.
This custom attribute can then be used in a decision split to decide the path in canvas.
- TedScottMentor
Manoj__ is correct.
Additionally, if you are using a data warehouse like Snowflake you can calculate the values like LTV and number of purchases and send those back to Braze as custom attributes.
Note: If your Braze instance is setup properly, you can already target based on number of pucrases and total purchase amount (refunds do not decrement these values).
https://www.braze.com/docs/user_guide/data/custom_data/purchase_events/#purchase-event-segmentation - ChintanCollaborator
luis123her you are right, Canvas by itself doesn't store values across events, so doing cumulative logic like “if total purchases > $50 across multiple events” can be tricky. But it's definitely doable with a little workaround using custom attributes and webhooks (or Connected Content).
Instead,Send a custom event when a user makes a purchase, and include the purchase_amount in the event properties (Looks like you are already doing it)
Track cumulative total by storing it as a custom user attribute (e.g., cumulative purchase total).
Use a webhook or Braze’s Connected Content to:- Grab the user’s current cumulative_purchase_total
- Add the new purchase_amount
- Update that total on the user profile using Braze’s API
- In terms of the Canvas - Trigger it based on purchase made event.
Add a Decision Split right after that checks the updated cumulative purchase total.
If it’s >= 50, send them down the “reward” path (or whatever).
If not, just continue the normal journey.
Related Content
- 2 months ago
- 7 months ago
- 5 months ago
- 2 years ago