Segment (Export)


With a push of a button you can send your Branch data to your Segment dashboard, helping you to understand the power of Branch as an acquisition pathway, export your data to your entire suite of analytics tools and build custom audiences upon Branch data.

This documentation explains how to send Branch-referred events to Segment. If you'd like to send Segment events to your Branch dashboard, please review the Segment Import integration.

How does it work?

Once the Branch SDK is integrated into an app, Branch can detect which links are leading to installs, re-opens, and users' actions. Enabling this integration and providing your Segment credentials will result in Branch automatically forwarding attributed events to Segment, in the exact format Segment expects.

What events does Branch send?

Branch will send attributed installs and opens, as well as any content events, lifecycle events,custom events and commerce events you track with Branch. Non-referred events, clicks, web session starts, and pageviews will be excluded. Branch also sends all the data that is attached to the link that drove the referred event. This will allow you to analyze which campaigns, channels, etc. are helping you acquire and engage users. You can see the list of fields that we send to Segment here.


WebSDK events not supported

We do not support Segment export for Branch WebSDK events.

What does it look like?

Branch events will appear as an event prepended with branch_ in your Segment debugger.


Additionally, individual events, such as those seen in Live View or visible when looking at People, will have Branch link data included. Here's an example:




  • This guide requires you to have already integrated the Branch and Segment mobile SDK(s).

Retrieve Segment Token

Find your Segment Token and enter it into the Branch Dashboard.

  1. Navigate to and log into the Dashboard.
  2. In the dashboard, navigate to your desired Workspace.
  3. In that Workspace, navigate to Sources and select the Source that has your app listed. Branch is not yet an independent Source, so Branch events appear within your app's Source.
  1. Click through to Settings > API Keys
  1. Copy your key and secret - you'll enter it into the Branch dashboard in a minute.

Enable the Integration

  1. On the Branch Dashboard (, navigate to the Integrations page.
  2. Search for Segment and click on the tile.
  3. Enter your Segment Token and hit Enable.


Please test integration!

Branch is not responsible for inaccurate API keys.

Pass Segment Anonymous ID

When you're ready to send data through Branch, you'll need to make sure you pass through the configured Segment Anonymous ID the Branch SDKs. In order to do so, you'll ask the Segment SDK to provide you with the Segment Anonymous ID, and pass this value through setRequestMetadataKey on the Branch SDKs.

Here's a sample snippet showing this. NOTE you must set the correct key before calling sessionBuilder()...init(). You must also initialize the Segment SDK before setting the request metadata in the Branch SDK.


Inside didFinishLaunchingWithOptions

Branch *branch = [Branch getInstance];
[[Branch getInstance] setRequestMetadataKey:@"$segment_anonymous_id" value:[[SEGAnalytics sharedAnalytics] getAnonymousId]];


Inside didFinishLaunchingWithOptions

if let branch = Branch.getInstance() {
    branch.setRequestMetadataKey("$segment_anonymous_id", value:"1234" as NSObject!);


Before you initialize in your Application#onCreate or Deep Link Activity's #onCreate.




In the above snippet, this is the Activity context.


What Branch Sends to Segment

PropertyValueSourced fromExample
eventBranch eventevent namebranch_OPEN
event_idUnique ID for the eventBranch event ID469939270182891107
propertiesBranch Link Data DictionaryLast Attributed Touch Data for the link to which the event was attributed"campaign": "Segment test", "channel": "Slack"
device_infoDevice Data, like OSBranch User Data for the device"os": "ANDROID"
anonymousIdSegment Anonymous IDSegment SDK provided Anonymous ID12356
IPIP of the eventDevice192.82.115.928

All of the above properties are received as flat properties[key], even though some are stored as dictionaries in Branch. They are grouped in our documentation for legibility.