Braze

Integrate in-app subscription events from RevenueCat with Braze

👍

The Braze integration is available to all users signed up after September '23, the legacy Grow and Pro plans, and Enterprise plans. If you're on a legacy Free or Starter plan and want to access this integration, migrate to our new pricing via your billing settings.

Braze can be a helpful integration tool in understanding what stage a customer is in and reacting accordingly. Using Braze can help you to create content that understands the context of your customers and their actions.

With our Braze integration, you can:

  • Send an onboarding campaign to a user towards the end of their free trial.
  • Allow customer support to grant a promotional subscription to a loyal user that experience issues.
  • Send campaigns to users who canceled their subscription or didn’t pursue after their free trial.

With accurate and up-to-date subscription data in Braze, you'll be set to turbocharge your campaigns ⚡️

Integration at a Glance

Includes RevenueSupports Negative RevenueSends Sandbox EventsIncludes Subscriber AttributesSends Transfer EventsOptional Event Types
✅✅Requires API keyReserved Attributes Only❌uncancellation_event
expiration_event
billing_issue_event
product_change_event

Events

The Braze integration tracks the following events:

EventDefault Event NameDescriptionApp StorePlay StoreAmazonStripePromo
Initial Purchaserc_initial_purchase_eventA new subscription has been purchased.✅✅✅✅❌
Trial Startedrc_trial_started_eventThe start of an auto-renewing subscription product free trial✅✅✅✅❌
Trial Convertedrc_trial_converted_eventWhen an auto-renewing subscription product converts from a free trial to normal paid period.✅✅✅✅❌
Trial Cancelledrc_trial_cancelled_eventWhen a user turns off renewals for an auto-renewing subscription product during a free trial period.✅✅✅✅❌
Renewalrc_renewal_eventAn existing subscription has been renewed or a lapsed user has resubscribed.✅✅✅✅❌
Cancellationrc_cancellation_eventA subscription or non-renewing purchase has been cancelled. See cancellation reasons for more details.✅✅✅✅✅
Uncancellationrc_uncancellation_eventA non-expired cancelled subscription has been re-enabled.✅✅✅❌❌
Non Subscription Purchaserc_non_subscription_purchase_eventA customer has made a purchase that will not auto-renew.✅✅✅✅✅
Subscription pausedrc_subscription_paused_eventA subscription has been paused.❌✅❌❌❌
Expirationrc_expiration_eventA subscription has expired and access should be removed.

If you have Platform Server Notifications configured, this event will occur as soon as we are notified (within seconds to minutes) of the expiration.

If you do not have notifications configured, delays may be approximately 1 hour.
✅✅✅✅✅
Billing Issuesrc_billing_issue_eventThere has been a problem trying to charge the subscriber. This does not mean the subscription has expired.

Can be safely ignored if listening to CANCELLATION event + cancel_reason=BILLING_ERROR.
✅✅✅✅❌
Product Changerc_product_change_eventA subscriber has changed the product of their subscription.

This does not mean the new subscription is in effect immediately. See Managing Subscriptions for more details on updates, downgrades, and crossgrades.
✅✅❌✅❌

For events that have revenue, such as trial conversions and renewals, RevenueCat will automatically record this amount along with the event in Braze.

RevenueCat subscriber attributes will be dispatched to Braze with the events detailed above and will populate in Braze's custom attributes for a customer as rc_customer_attribute_* (where * is replaced by the attribute name) and the value is set to that key (e.g: rc_customer_attribute_naps_logged: "123”). If you are setting the optional Braze User Alias Object fields in RevenueCat, these subscriber attributes will be filtered out from the collection before we dispatch the custom attributes to Braze.

RevenueCat will also send your customer's active entitlement ID(s) as an array of rc_active_entitlement_ids.

Setup

1. Set Braze User Identity

If you're using the Braze SDK, you can set the User Id to match the RevenueCat App User Id. This way, events sent from the Braze SDK and events sent from RevenueCat can be synced to the same user.

Configure the Braze SDK with the same App User Id as RevenueCat or use the .changeUser() method on the Braze SDK.

// Configure Purchases SDK
Purchases.configure(withAPIKey: "public_sdk_key", appUserID: "my_app_user_id")

// Change user in Braze SDK
Appboy.sharedInstance()?.changeUser("my_app_user_id")

// Optional User Alias Object attributes
Purchases.shared.attribution.setAttributes(["$brazeAliasName": "name",
                             "$brazeAliasLabel": "label"])
// Configure Purchases SDK
[RCPurchases configureWithAPIKey:@"public_sdk_key" appUserID:@"my_app_user_id"];

// Change user in Braze SDK
[[Appboy sharedInstance] changeUser:@"my_app_user_id"];

// Optional User Alias Object attributes
[[RCPurchases sharedPurchases] setAttributes:@{
    @"$brazeAliasName": @"name",
    @"$brazeAliasLabel": @"label"
}];
// Configure Purchases SDK
Purchases.configure(this, "public_sdk_key", "my_app_user_id");

// Change user in Braze SDK
Braze.getInstance(context).changeUser(my_app_user_id);

// Optional User Alias Object attributes
Map<String, String> attributes = new HashMap<String, String>();
attributes.put("$brazeAliasName", "name");
attributes.put("$brazeAliasLabel", "label");

Purchases.getSharedInstance().setAttributes(attributes);

(Optional) Send User Alias Object fields to RevenueCat

If you are looking to send an alternative unique user identifier that is different than your App User ID, update users with the below data as Subscriber Attributes.

KeyDescription
$brazeAliasNameThe Braze 'alias_name' in User Alias Object
$brazeAliasLabelThe Braze 'alias_label' in User Alias Object

Both attributes are required for the User Alias Object to be sent alongside your event data. These properties can be set and removed manually, like any other Subscriber Attribute.

RevenueCat will always use the User Alias Object to identify events into Braze, if set, as opposed to the RevenueCat App User ID.

❗️

Remove any client-side purchase tracking

Make sure to remove all client-side tracking of revenue. Since RevenueCat will be sending events for all revenue actions, tracking purchases with the Braze SDK directly can lead to double counting of revenue in Braze.

2. Send RevenueCat Events to Braze

After you've set up the Purchases SDK and Braze SDK to have the same user identity, you can "turn on" the integration and configure the event names from the RevenueCat dashboard.

  1. Navigate to your project in the RevenueCat dashboard and find the Integrations card in the left menu. Select + New

  1. Choose Braze from the Integrations menu
  2. Add your Braze instance and API key
  3. Enter the event names that RevenueCat will send or choose the default event names
  4. Select whether you want sales reported as gross revenue (before app store commission), or after store commission and/or estimated taxes.
Braze configuration page

Braze configuration page

Sample events

Below are sample JSONs that are delivered to Braze for most events.

{
    "events": [
        {
            "name": "rc_initial_purchase_event",
            "time": "2022-09-04T18: 06: 21.000000",
            "properties": {
                "product_id": "monthly.sub.1",
                "store": "APP_STORE",
                "revenue": 7.99,
                "app_id": "1234567890"
            },
            "external_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c"
        }
    ]
}
{
    "events": [
        {
            "name": "rc_trial_started_event",
            "time": "2022-09-13T16: 16: 19.000000",
            "properties": {
                "product_id": "weekly.sub",
                "store": "APP_STORE",
                "revenue": 0,
                "app_id": "1234567890"
            },
            "external_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c"
        }
    ]
}
{
    "events": [
        {
            "name": "rc_trial_converted_event",
            "time": "2022-09-13T16: 16: 39.000000",
            "properties": {
                "product_id": "weekly.sub",
                "store": "APP_STORE",
                "revenue": 2.99,
                "app_id": "1234567890"
            },
            "external_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c"
        }
    ]
}
{
    "events": [
        {
            "name": "rc_trial_cancelled_event",
            "time": "2022-09-13T16: 15: 48.000000",
            "properties": {
                "product_id": "monthly.sub.1",
                "store": "APP_STORE",
                "revenue": 0,
                "cancel_reason": "UNSUBSCRIBE",
                "app_id": "1234567890"
            },
            "external_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c"
        }
    ]
}
{
    "events": [
        {
            "name": "rc_renewal_event",
            "time": "2022-09-14T00: 16: 36.000000",
            "properties": {
                "product_id": "monthly.sub.1",
                "store": "APP_STORE",
                "revenue": 6.99,
                "app_id": "1234567890"
            },
            "external_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c"
        }
    ]
}
{
    "events": [
        {
            "name": "rc_cancellation_event",
            "time": "2022-09-13T16: 15: 19.000000",
            "properties": {
                "product_id": "yearly.sub",
                "store": "APP_STORE",
                "revenue": 0,
                "cancel_reason": "UNSUBSCRIBE",
                "app_id": "1234567890"
            },
            "external_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c"
        }
    ]
}
{
    "events": [
        {
            "name": "rc_uncancellation_event",
            "time": "2023-09-15T17: 20: 01.000000",
            "properties": {
                "product_id": "monthly.sub.1",
                "store": "PLAY_STORE",
                "revenue": 0,
                "app_id": "1234567890"
            },
            "external_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c"
        }
    ]
}
{
    "events": [
        {
            "name": "rc_non_subscription_purchase_event",
            "time": "2019-01-21T16: 55: 44.000000",
            "properties": {
                "product_id": "tokens.pack.100",
                "store": "APP_STORE",
                "revenue": 4.99,
                "app_id": "1234567890"
            },
            "external_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c"
        }
    ]
}
{
    "events": [
        {
            "name": "rc_subscription_paused_event",
            "time": "2022-09-13T16: 18: 06.000000",
            "properties": {
                "product_id": "monthly.sub.1",
                "store": "PLAY_STORE",
                "revenue": 0,
                "auto_resume_at": "2023-09-27T15: 57: 26.000000",
                "app_id": "1234567890"
            },
            "external_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c"
        }
    ]
}
{
    "events": [
        {
            "name": "rc_expiration_event",
            "time": "2022-09-13T15: 45: 50.000000",
            "properties": {
                "product_id": "monthly.sub.1",
                "store": "APP_STORE",
                "revenue": 0,
                "expiration_reason": "UNSUBSCRIBE",
                "app_id": "1234567890"
            },
            "external_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c"
        }
    ]
}
{
    "events": [
        {
            "name": "rc_billing_issue_event",
            "time": "2022-09-13T16: 18: 06.000000",
            "properties": {
                "product_id": "monthly.sub.1",
                "store": "PLAY_STORE",
                "revenue": 0,
                "grace_period_expiration_at": "2022-09-27T15: 57: 26.000000",
                "app_id": "1234567890"
            },
            "external_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c"
        }
    ]
}
{
    "events": [
        {
            "name": "rc_product_change_event",
            "time": "2022-06-09T02: 30: 35.000000",
            "properties": {
                "product_id": "monthly.sub.1",
                "store": "APP_STORE",
                "revenue": 0.0,
                "new_product_id": "yearly.sub"
            },
            "external_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c"
        }
    ]
}

Subscription Status Attribute

Whenever RevenueCat sends an event to Braze, we'll update the rc_subscription_status user attribute with any applicable changes, using one of the following values:

StatusDescription
activeThe customer has an active, paid subscription which is set to renew at their next renewal date.
introThe customer has an active, paid subscription through a paid introductory offer.
cancelledThe customer has a paid subscription which is set to expire at their next renewal date.
grace_periodThe customer has a paid subscription which has entered a grace period after failing to renew successfully.
trialThe customer is in a trial period which is set to convert to paid at the end of their trial period.
cancelled_trialThe customer is in a trial period which is set to expire at the end of their trial period.
grace_period_trialThe customer was in a trial period and has now entered a grace period after failing to renew successfully.
expiredThe customer's subscription has expired.
promotionalThe customer has access to an entitlement through a granted RevenueCat promotional subscription.
expired_promotionalThe customer previously had access to an entitlement through a granted RevenueCat promotional subscription that has since expired.
pausedThe customer has a paid subscription which has been paused and is set to resume at some future date.

For customers with multiple active subscriptions, this attribute will represent the status of only the subscription for which the most recent event occurred. Therefore, we recommend using rc_active_entitlements to understand whether your customers have multiple active subscriptions to be accounted for.

Please note that since this attribute is set and updated when events are delivered, subscribers with events prior to our release of this attribute (during November 2023) will not have this attribute set until/unless a future event (renewal, cancellation, etc) occurs.