Introduction

CleverTap can track the following information from Branch:

  • Install events
  • Lifecycle events
  • Commerce events
  • Content events
  • Custom events

For more information about each event, refer to Branch documentation.

Integrating Branch

To enable Branch integration with CleverTap dashboard, proceed as follows:

Step 1: 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.

Branch Dashboard

Branch Dashboard

Step 2: Integrate AppsFlyer

The integration steps vary for Android and iOS. The steps for both are listed below.

For Android App

  1. To track attribution and events data in your Android app, perform the steps listed in Branch Android SDK Integration Guide.
  2. Add the following code to your Android app code before ​you ​initialize ​onCreate() or Deep ​Link ​Activity’s onCreate() 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 AppsFlyer.

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

  1. To track attribution and events data in your iOS app, perform the steps listed in Branch iOS SDK Integration Guide.
  2. 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!);
}

Step 3: Enabling the Attribution Partner

After successful integration, Branch starts to push install event data to CleverTap. To receive the remaining events in CleverTap from Branch, you need to enable the same in CleverTap and Branch dashboards, respectively. For more information about enabling this advanced setup, refer to CleverTap Attribution Partner Settings.

Viewing Data in Dashboard

You can now view the event data in the CleverTap dashboard. To do so, proceed as follows:

  1. From the CleverTap dashboard, navigate to Analytics > Events.
  2. Apply the required filters for the selected event. The filters vary depending upon the type of event.

For Install Events: All the install events are tracked under the UTM Visited event.

Applying Filters

Applying Filters

Note

Lifecycle events, Commerce events, Content events, and Custom events received from the Branch are prefixed with BR in CleverTap.

Updated about a month ago


Branch


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.