Branch

This guide describes how to add and configure Branch integration.

Branch is a platform to increase mobile revenue with enterprise-grade links built to acquire, engage, and measure across all devices, channels, and platforms.

How does Integration Work?

This integration works in two ways.

1. Receive Attribution Data from Branch

Once you successfully configured Branch integration, Apphud will receive attribution data from it. You can view this data on user's page:

2. Send Subscription Events to Branch

Apphud can also send all subscription events to Branch. So you could view these events in Branch dashboard and Branch could pass this data to their partners. This will help to measure efficiency of your ad campaigns.

How to Add Integration?

Step 1
2
3
4
5
6
7
8
9
10
11
✅ 12
Step 1

Integrate Branch SDK into your iOS app.

2

At Apphud go to "Integrations" section and add Branch:

3

Copy Webhook URL:

4

Sign in to Branch, go to "Data Feeds" in "Data Import & Export" section. Open "Webhooks" and add new webhook:

5

Paste Webhook URL copied from Apphud to "Send a webhook to" field. Make sure you selected POST option and INSTALL event:

6

Create one more Branch webhook using the same Webhook URL, but select OPEN event instead of INSTALL:

7

As a result, you should have 2 webhooks configured in Branch: for INSTALL and OPEN events:

8

Make sure you are in LIVE environment in Branch.

Open "Account Settings" in Branch and copy"Branch Key" :

Paste copied key into "Branch live key" field in integration settings:

9

Return to Branch end switch to TEST environment.

Copy test Branch Key and paste into "Branch test key" field in Apphud:

10

You can enter your custom event names or disable some.

Please, use only lower-case alpha-numeric characters (a-z and 0-9) for your in-app event names.

11

Enable integration:

✅ 12

Save changes:

While configuring integration you can also choose between sending revenue as sales or proceeds (without Apple 15%-30% commission).

You can read more how Apple calculates commission here.

In order to receive Branch attribution data from Facebook, you should accept Facebook’s "Advanced Mobile Measurement Agreement" using this link.

Events Cheat Sheet

This is a list of all possible events and their parameters that are being sent to Branch.

You can read more about subscription events here and parameters here.

Trial
Cancellations
Introductory Offer
Regular
Promo Offer
Other Events
Trial

Trial period started

Event name: START_TRIAL

Default event alias: apphud_trial_started

Parameters:

  • content_items[0].$sku: String

  • content_items[0].$price: Float

  • content_items[0].$quantity = 1

  • unit: String

  • units_count: Integer

Successful conversion from trial period to regular subscription

Event name: PURCHASE

Default event alias: apphud_trial_converted

Parameters:

  • content_items[0].$sku: String

  • content_items[0].$price: Float

  • content_items[0].$quantity = 1

  • revenue: Float

  • currency: String

Failed conversion from trial period to regular subscription

Default event name and alias: apphud_trial_expired

Parameters:

  • product_id: String

  • reason: String

Cancellations

Trial Canceled

Default event name and alias: apphud_trial_canceled

Parameters:

  • product_id: String

Subscription Canceled

Default event name and alias: apphud_subscription_canceled

Parameters:

  • product_id: String

Autorenew disabled (Deprecated)

Default event name and alias: apphud_autorenew_disabled

Parameters:

  • product_id: String

Autorenew enabled

Default event name and alias: apphud_autorenew_enabled

Parameters:

  • product_id: String

Introductory Offer

Introductory offer started

Event name: PURCHASE

Default event alias: apphud_intro_started

Parameters:

  • content_items[0].$sku: String

  • content_items[0].$price: Float

  • content_items[0].$quantity = 1

  • revenue: Float

  • currency: String

  • offer_type: String

  • unit: String

  • units_count: Integer

Introductory offer renewed

Event name: PURCHASE

Default event alias: apphud_intro_renewed

Parameters:

  • content_items[0].$sku: String

  • content_items[0].$price: Float

  • content_items[0].$quantity = 1

  • revenue: Float

  • currency: String

  • offer_type: String

  • unit: String

  • units_count: Integer

Successful conversion from introductory offer to regular subscription

Event name: PURCHASE

Default event alias: apphud_intro_converted

Parameters:

  • content_items[0].$sku: String

  • content_items[0].$price: Float

  • content_items[0].$quantity = 1

  • revenue: Float

  • currency: String

  • offer_type: String

Failed conversion from introductory offer to regular subscription or failed renew

Default event name and alias: apphud_intro_expired

Parameters:

  • product_id: String

  • reason: String

  • offer_type: String

Refund during introductory offer

Event name: PURCHASE

Default event alias: apphud_intro_refunded

Parameters:

  • content_items[0].$sku: String

  • content_items[0].$price: Float

  • content_items[0].$quantity = 1

  • revenue: Float

  • currency: String

  • reason: String

  • offer_type: String

Regular

Subscription started

Event name: PURCHASE

Default event alias: apphud_subscription_started

Parameters:

  • content_items[0].$sku: String

  • content_items[0].$price: Float

  • content_items[0].$quantity = 1

  • revenue: Float

  • currency: String

Subscription renewed

Event name: PURCHASE

Default event alias: apphud_subscription_renewed

Parameters:

  • content_items[0].$sku: String

  • content_items[0].$price: Float

  • content_items[0].$quantity = 1

  • revenue: Float

  • currency: String

Subscription expired

Default event name and alias: apphud_subscription_expired

Parameters:

  • product_id: String

  • reason: String

Subscription refunded

Event name: PURCHASE

Default event alias: apphud_subscription_refunded

Parameters:

  • content_items[0].$sku: String

  • content_items[0].$price: Float

  • content_items[0].$quantity = 1

  • revenue: Float

  • currency: String

  • reason: String

Promo Offer

Promotional offer started

Event name: PURCHASE

Default event alias: apphud_promo_started

Parameters:

  • content_items[0].$sku: String

  • content_items[0].$price: Float

  • content_items[0].$quantity = 1

  • offer_id: String

  • revenue: Float

  • currency: String

  • offer_type: String

  • unit: String

  • units_count: Integer

Promotional offer renewed

Event name: PURCHASE

Default event alias: apphud_promo_renewed

Parameters:

  • content_items[0].$sku: String

  • content_items[0].$price: Float

  • content_items[0].$quantity = 1

  • offer_id: String

  • revenue: Float

  • currency: String

  • offer_type: String

  • unit: String

  • units_count: Integer

Successful conversion from promotional offer to regular subscription

Event name: PURCHASE

Default event alias: apphud_promo_converted

Parameters:

  • content_items[0].$sku: String

  • content_items[0].$price: Float

  • content_items[0].$quantity = 1

  • offer_id: String

  • revenue: Float

  • currency: String

  • offer_type: String

Failed conversion from promotional offer to regular subscription or failed renew

Default event name and alias: apphud_promo_expired

Parameters:

  • product_id: String

  • offer_id: String

  • reason: String

  • offer_type: String

Refund during promotional offer

Event name: PURCHASE

Default event name: apphud_promo_refunded

Parameters:

  • content_items[0].$sku: String

  • content_items[0].$price: Float

  • content_items[0].$quantity = 1

  • offer_id: String

  • revenue: Float

  • currency: String

  • reason: String

  • offer_type: String

Other Events

Non renewing purchase

Event name: PURCHASE

Default event alias: apphud_non_renewing_purchase

Parameters:

  • content_items[0].$sku: String

  • content_items[0].$price: Float

  • content_items[0].$quantity = 1

  • revenue: Float

  • currency: String

Non renewing purchase refunded

Event name: PURCHASE

Default event alias: apphud_non_renewing_purchase_refunded

Parameters:

  • content_items[0].$sku: String

  • content_items[0].$price: Float

  • content_items[0].$quantity = 1

  • revenue: Float

  • currency: String

  • reason: String

Billing Issue

Default event name and alias: apphud_billing_issue

Parameters:

  • product_id: String

Testing Integration

Step 1
2
3
4
✅ 5
Step 1

Please make sure Branch SDK is properly integrated in your app and Branch integration is configured in Apphud.

2

Open Xcode, remove your app from test device, reset Advertising Identifier and Run the app.

3

Make a test purchase.

You can read more about testing purchases here.

4

You will see attribution data in user's page:

✅ 5

Open "Liveview" tab in Branch and you will see Apphud events there.

Don't forget to switch Branch to TEST mode if you use setIntegrationsTestMode().