Skip to content

Purchase events

Learn about purchase events and properties, their usage, segmentation, where to view relevant analytics, and more.

Purchase events are purchase actions taken by your users. These events are used to record in-app purchases and establish the Lifetime Value (LTV) for each user profile. These purchase events must be set up by your team. Logging purchase events allows you to add properties like quantity and type, helping you further target your users based on these properties.

Logging purchase events

You can log purchases by passing a purchase object through the /users/track endpoint.

The following lists methods across various platforms that are used to log purchases. Within these pages, you will also find documentation on how to add properties and quantities to your purchase event. You can further target your users based on these properties.

Viewing purchase data

After you have set up and begun logging purchase events, you can view this purchase data on a user’s profile in the Overview tab.

Using purchase data

There are several ways you can use purchase data in Braze:

  • Segmentation: Use purchase data to create segments of users based on their purchasing behavior.
  • Personalization: Use purchase data to personalize messages to users.
  • Trigger messages: Set up messages to trigger based on purchase events.
  • Analytics: Analyze your purchase data to gain insights into user behavior and the effectiveness of your marketing campaigns.

Segmentation

You can trigger any number or type of follow-up campaigns based on logged purchase events. For example, you can create a segment of users who made a purchase in the last 30 days, or a segment of users who have spent over a certain amount.

The following segmentation filters are available when targeting users:

  • First Made Purchase
  • First Purchase For App
  • Last Purchased Product
  • Money Spent
  • Purchased Product
  • Total Number of Purchases
  • X Money Spent in Y Days
  • X Product Purchased in Y Days
  • X Purchase Property in Y Days
  • X Purchases in Last Y Days

For details on each filter, refer to the Segmentation filters glossary and filter by “Purchase behavior”.

Filtering for users who made exactly three purchases

Personalization

Like any other type of data you collect from your users, you can use purchase data to personalize your messaging through Liquid. For example, you can send a personalized email to a user recommending products similar to ones they just purchased.

Let’s say you have a purchase event property called last_purchased_product that stores the name of the last product a user purchased. You could use this property to personalize an email message like this:

1
2
3
4
5
6
7
{% if ${last_purchased_product} == "Running Shoes" %}
  We hope you're enjoying your new running shoes! Based on your recent purchase, you might also like these running shorts and water bottles.
{% elsif ${last_purchased_product} == "Yoga Mat" %}
  We hope you're enjoying your new yoga mat! Based on your recent purchase, you might also like these yoga blocks and straps.
{% else %}
  Thank you for your recent purchase! We hope you're enjoying your new item.
{% endif %}

In this example, the message is personalized based on the last_purchased_product property. If the last product the user purchased was “Running Shoes”, they receive a message recommending running shorts and water bottles. If the last product was a “Yoga Mat”, they receive a message recommending yoga blocks and straps. If the last_purchased_product is anything else, they receive a generic thank you message.

Trigger messages

A common use case is to automatically send a message, such as an email, when a user makes a purchase. For example, you can send a thank you message or discount code for a future purchase.

To do so, create an action-based campaign or Canvas, then set the trigger action to Make Purchase. You can also specify additional conditions for the trigger, such as the product purchased or the purchase amount.

You can also personalize your triggered message with Liquid.

1
Thank you for your purchase of ${purchase_product_name}! As a token of our appreciation, here's a discount code for your next purchase: SAVE10

In this example, ${purchase_product_name} is a custom attribute that you would replace with the actual attribute name that stores the name of the purchased product in your Braze setup.

Analytics

In addition to tracking purchase metrics for segmentation, Braze also notes the number of purchases for each product and the revenue generated over time. This can be helpful to see which products are most popular or measure the impact of a promotional campaign on sales.

You can view this data on the Revenue Report page.

Lifetime revenue calculation

Braze uses purchase events to calculate the lifetime revenue (also called lifetime value or LTV) of a user, which is a prediction of the net profit attributed to the entire future relationship with a customer. This can help you make informed decisions about customer acquisition and retention strategies.

\[\text{Lifetime revenue} = \frac{\text{Total spend in dollars}}{\text{Total number of purchase events}}\]

There are two main places in Braze you can reference to understand your users’ LTV:

  • For overall metrics like Lifetime revenue and the Lifetime value per user for each app and site, refer to your Revenue Report.
  • To understand a specific user’s lifetime revenue, refer to their user profile.
Impact of refunds on lifetime revenue

When using purchase events to track purchase data, you should track refunds by logging a Braze purchase event with a negative price property. This approach will maintain an accurate total for the lifetime revenue.

However, keep in mind the refund will count as an additional purchase event. Let’s consider the following example. Sam makes their first purchase for $12 but returns part of the purchase for a refund of $5. Sam’s profile would log:

  • 1 purchase with a price of $12
  • 1 purchase with a price of -$5
  • Lifetime revenue of $7

While Sam would have two purchase events on their profile, in reality, they only made one purchase. This is important to consider if you have any segments or use cases built around the number of purchases a user has made. Constant refunds will inflate the purchase count on user’s profile.

Purchase event properties

With purchase event properties, you can set properties on purchases that can be used to further qualify trigger conditions, increase personalization in messaging, and generate more sophisticated analytics through raw data export. Property value types (string, numeric, boolean, date) vary per platform and are often assigned as key-value pairs.

For example, if an ecommerce application wanted to send a message to a user after making a purchase, they could additionally improve their target audience and allow for increased campaign personalization by adding a purchase event property of brand_name.

Example of triggering based on purchase event properties:

Action-based delivery settings to send a campaign to users who purchase headphones with a brand name equal to HeadphoneMart

Refer to purchase properties object for more.

Event property segmentation

Event property segmentation allows you to target users based not just on custom events taken but also on the properties associated with those events. This feature adds additional filtering options when segmenting purchase and custom events.

These segmentation filters include:

  • Has done the custom event with property Y with value V X times in the last Y days.
  • Has made any purchases with property Y with value V X times in the last Y days.
  • Adds the ability to segment within 1, 3, 7, 14, 21, and 30 days.

Unlike with Segment Extensions, segments used are updated in real-time, support an unlimited amount of segments, offer a look back history of at most 30 days, and incur data points. Because of the additional data point charge, you must contact your Braze customer success manager to get event properties turned on for your custom events.

When approved, additional properties can be added in the dashboard under Data Settings > Custom Events by clicking Manage Properties. You can then use these event properties in the target step of the campaign or Canvas builder.

Canvas entry properties and event properties

You can leverage canvas_entry_properties and event_properties in your Canvas user journeys. Check out Canvas entry properties and event properties for more information and examples.

Canvas entry properties are the properties you map for Canvases that are action-based or API-triggered. Note that the canvas_entry_properties object has a maximum size limit of 50 KB.

For Canvas Flow messaging, canvas_entry_properties can be used in Liquid in any Message step. Use this Liquid when referencing these properties: canvas_entry_properties${property_name}. Note that the events must be custom events or purchase events to be used this way.

For example, consider the following request: \"canvas_entry_properties\" : {\"product_name\" : \"shoes\", \"product_price\" : 79.99}. You could add the word “shoes” to a message with the Liquid {{canvas_entry_properties.${product_name}}}.

For the Canvases built with the original editor, canvas_entry_properties can be referenced only in the first full step of a Canvas.

Event properties refer to the properties you set for custom events and purchases. These event_properties can be used in campaigns with action-based delivery and Canvases.

In Canvas Flow, custom event and purchase event properties can be used in Liquid in any Message step that follows an Action Paths step. For Canvas Flow, make sure to use {{event_properties.${property_name}}} if referencing these event_properties. These events must be custom events or purchase events to be used this way in the Message component.

For the original Canvas editor, event_properties can’t be used in scheduled full steps. However, you can use event_properties in the first full step of an action-based Canvas, even if the full step is scheduled.

In the first Message step following an Action Path, you can use event_properties related to the event referenced in that Action Path. These event_properties can only be used if the user actually took the action (didn’t go to the Everyone Else group). You can have other steps (that are not another Action Paths or Message step) in between this Action Paths and the Message step.

Log purchases at the order level

If you would like to log purchases at the order level instead of the product level, you can use the order name or order category as the product_id. Refer to our purchase object specification to learn more.

Blocklisting purchase events

You may occasionally identify purchase events that either consume too many data points, are no longer useful to your marketing strategy, or were recorded in error. To stop this data from being sent to Braze, you can blocklist the custom data object while your engineering team works to remove it from the backend of your app or website.

In the Braze dashboard, you can manage blocklisting from Data Settings > Products. Check out Managing custom data to learn more.

HOW HELPFUL WAS THIS PAGE?
New Stuff!