Create a computed attribute for the sum of purchases

Learn how to use computed attributes to sum the purchase amounts made by a user across multiple sales channels. A single customer might purchase on your website, in your mobile app, and in your brick-and-mortar store. With the computed attributes feature, you can sum the purchase amounts made by a customer across these channels and use this sum to define audiences and for other personalization. For more information, please visit the computed attributes UI guide.

Transcript
Hi marketers, let’s say you have a brand that sells things and you have loyal customers who buy from you over and over again. I’m going to show you how you can use the computed attributes feature to sum the purchase amounts across multiple purchases on all of your sales channels. You’ll be able to use this sum in your segment definitions and for personalization. Sounds pretty awesome, right? The first thing you need to know is how the purchase amounts are captured in your XDM schemas. Our sample brand Luma captures this in the standard XDM field price total or commerce.order.price total. We set the price total in events that set the event type field to commerce.purchases and we do that consistently across all event data sets containing purchases. Once I’ve confirmed my data model, I can set up the computed attribute. In the platform or AJO interface, go to customer profiles and then open the computed attributes tab. Click create computed attribute. Then enter display name and description. Then you need to define the attribute. I’ll start by creating a condition. For this I’ll just drag the purchases event onto the canvas. Then I define my function. For this I want to use sum and I want to sum those commerce order price total fields. Then I choose my time window. I want to sum purchases over the last month. Now ordinarily this would sum the purchases at the end of each month but I want to calculate this daily as the month progresses. So here I’ll use the fast refresh feature which will calculate a new sum daily. I’ll save. At this point it’s in a draft state and I can still edit. You’ll see it hasn’t evaluated yet and is set to run daily. I’ll hit publish. Then I’ll come back to my website and make a few test purchases. Then I can come back tomorrow and confirm that my computed attribute has evaluated successfully. On a weekly basis a sampling job will run and you can see sample profiles containing the attribute. You can also look up your test profile using any of its identities. That’s it and good luck!
recommendation-more-help
9051d869-e959-46c8-8c52-f0759cee3763