Skip to content

RevenueCat

RevenueCat is the single source of truth for your subscription status across iOS, Android, and web. Whether you are building a new app or already have millions of subscribers, you can use RevenueCat to build cross-platform in-app purchases, manage your products and subscribers, and analyze your data - no server code required.

The RevenueCat and Braze integration allows you to automatically sync your customer’s purchase and subscription lifecycle events across platforms. This allows you to build campaigns that react to the subscription lifecycle stage of your customers, such as engaging with customers that opted out during their free trial or sending reminders to customers with billing issues.

Prerequisites

At a minimum, you will need to enable the integration from the RevenueCat dashboard to connect RevenueCat to Braze. If you’re using the Braze SDK, you can use the RevenueCat and Braze SDKs together to enhance the integration by ensuring the same customer identifier is being used in both systems.

Use Cases

  • Trigger an onboarding campaign highlighting your premium features when a customer starts a free trial.
  • Send a reminder to update billing information when a “Billing Issue” event is received.
  • Send a feedback survey after a customer cancels a free trial.

Integration

Step 1: Set Braze user identity

In the Braze SDK, you can set the Braze user ID to match the RevenueCat app user ID, ensuring events sent from the Braze and RevenueCat can be synced to the same user.

Configure the Braze SDK with the same app user ID as RevenueCat or use the Braze SDK .changeUser() method.

1
2
3
4
5
6
7
8
9
// 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.setAttributes(["$brazeAliasName" : "name", 
                             "$brazeAliasLabel" : "label"])
1
2
3
4
5
6
7
8
9
10
11
// 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"
}];
1
2
3
4
5
6
7
8
9
10
11
12
// 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);

Send user alias object to Braze (optional)

If you want to send an alternative unique user identifier different from the RevenueCat app user ID, update users with the following data as RevenueCat subscriber attributes.

Both attributes are required for the user alias object to be sent alongside your event data. These properties can be set manually, like any other RevenueCat subscriber attribute. Example code snippets are shown in step one.

Step 2: Send RevenueCat events to Braze

After you’ve set up the RevenueCat 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.
  2. Next, select Braze from the available integration and add your Braze instance and Braze REST API key.
  3. Enter the event names that RevenueCat will send or choose the default event names. More details on available events can be found in step 3.
  4. Select whether you want RevenueCat to report proceeds (after app store cut) or revenue (gross sales).

Braze settings in RevenueCat with fields for Braze instance, API key identifier, and sandbox identifier.

Step 3: Configure event names

Enter the event names that RevenueCat will send or select from the default event names by selecting Use Default Event Names. The events that RevenueCat supports sending are described in the following chart.

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

Using this integration

After configuring Braze settings in RevenueCat, events will automatically begin flowing from RevenueCat to Braze without any other action on your part.

Customization

Add a sandbox API key for Testing

If you only provide one Braze REST API key to RevenueCat, only production events will be sent. If you also want to send sandbox testing events, create another Braze REST API key and add it to your Braze settings in RevenueCat.

HOW HELPFUL WAS THIS PAGE?
New Stuff!