Branch
Overview
Branch is a mobile measurement and deep linking platform that helps acquire and engage users efficiently across all devices, channels, and platforms. This document provides information about integrating Branch and CleverTap. This integration helps track the following information from Branch:
- Install events: These events can be organic install events and inorganic install events.
- Custom Events: These events can include any events (other than install events) that are provided by the attribution partner or tracked in the app. The following events are tracked for Branch: Lifecycle events, Commerce events, and Content events. For more information about each event, refer to Branch documentation.
To learn more about these events and their default attribution settings in the CleverTap dashboard, refer to Types of Data.
Integrating Branch
To enable Branch integration with the CleverTap dashboard, proceed as follows:
- Add CleverTap Credentials to Branch Dashboard.
- Integrate Branch.
- Setup for Organic Install and Custom Events.
Add CleverTap Credentials to Branch Dashboard
To activate integration with CleverTap from the Branch dashboard, follow the steps listed under CleverTap integration with Branch section of Branch documentation.
Region
In the above figure, enter the region of your CleverTap account. The following table helps identify the region of your account:
Integrate Branch
The integration steps vary for Android and iOS. The steps for both are listed below.
For Android App
- To track attribution and events data in your Android app, perform the steps listed in Branch Android SDK Integration Guide.
- Add the following code to your Android app code before βyou βinitialize β
onCreate()
or Deep βLink βActivityβsonCreate()
in βyour application:
For SDK version 4.2.0 and above
The getCleverTapAttributionIdentifier
method is deprecated for CleverTap Android SDKs version 4.2.0 and above. Use the new getCleverTapID
method to get the CleverTap ID on the OnInitCleverTapIDListener
to set CustomerUserId
method of Branch.
cleverTapInstance.getCleverTapID(new OnInitCleverTapIDListener() {
@Override
public void onInitCleverTapID(final String cleverTapID) {
// Callback on main thread
Branch branch = Branch.getInstance();
branch.setRequestMetadata("$clevertap_attribution_id",
cleverTapID);
...
Branch.initSession(...);
}
});
cleverTapInstance?.getCleverTapID {
// Callback on main thread
Branch.getInstance()?.setRequestMetadata("$clevertap_attribution_id",
it)
...
Branch.initSession(...)
}
SDK version 4.1.1 and below
Branch branch = Branch.getInstance();
branch.setRequestMetadata("$clevertap_attribution_id",
cleverTapInstance.getCleverTapAttributionIdentifier());
...
Branch.initSession(...);
Branch.getInstance()?.setRequestMetadata("$clevertap_attribution_id",
cleverTapInstance?.cleverTapAttributionIdentifier);
...
Branch.initSession(...);
For iOS App
To integrate Branch with CleverTap for an iOS app:
- To track attribution and events data in your iOS app, perform the steps listed in Branch iOS SDK Integration Guide.
- Add the following code inside
didFinishLaunchingWithOptions
of iOS app code:
Branch *branch = [Branch getInstance];
[CleverTap autoIntegrate];
[[Branch getInstance] setRequestMetadataKey:@"$clevertap_attribution_id"
value:[[CleverTap sharedInstance] profileGetCleverTapAttributionIdentifier]];
CleverTap.autoIntegrate()
if let branch = Branch.getInstance() {
branch.setRequestMetadataKey("$clevertap_attribution_id",
value:CleverTap.sharedInstance()?profileGetCleverTapAttributionIdentifier() as
NSObject!);
}
Setup for Organic Install and Custom Events
After successful integration, the Branch starts pushing inorganic install events data to CleverTap. To receive additional events, proceed as follows:
- Navigate to Settings > Partners and scroll down to the Attribution partners section.
- The Attribution partner - Branch popup appears on the right side of the screen.
- Select Custom events to accept this event data when shared by the partner.
- Click Save. On clicking, the following message displays at the top of the screen: Changes saved. Admins are notified of this via email.
Viewing Data in Dashboard
You can now view the event data on the CleverTap dashboard. To do so, proceed as follows:
- From the CleverTap dashboard, navigate to Analytics > Events.
- Apply the required filters for the selected event. The filters vary depending on the type of event.
- For Install Events: All the install events are tracked under the UTM Visited event.
- For Custom Events: Lifecycle events, Commerce events, Content events, and Custom events received from Branch are prefixed with BR in CleverTap.
Updated 4 months ago