Branch links infrastructure for top brands, enabling seamless tracking of mobile advertising campaigns. By integrating Branch’s mobile events with Treasure Data through a webhook, you can ingest your mobile data directly into Treasure Data for comprehensive analysis. This integration ensures that every relevant mobile event is captured and stored in Treasure Data.
Branch supports event tracking through Android and iOS SDKs, which automatically collect the following event types:
- Click
- Open
- Install
- Reinstall
- Impression
- Custom Events
- Content Events
- Lifecycle Events
- Subscription and In-App Purchase Events
These events can be transferred to Treasure Data using Branch's webhook functionality and the Treasure Data Ingest API, allowing you to maximize the value of your mobile data within Treasure Data CDP.
For detailed information about events, see Branch Event Documentation.
For a comprehensive list of events, field definitions, data types, and field availability by event type, see Branch Event Ontology.
To set up the webhook configuration in the Branch Console, follow these steps to ensure that events are forwarded to Treasure Data in real-time:
Treasure Data requires a Write-Only API Key for authentication during data import. To generate this key:
- Navigate to My Profile in the Treasure Data Console.
- Select the API Key tab.
- Generate a Write-Only API key. For further details, see Generating API Keys.
Branch supports a native integration with Treasure Data, where events like IMPRESSION, CLICK, OPEN, INSTALL, REINSTALL, USER_LIFECYCLE_EVENT, CONTENT_EVENT, COMMERCE_EVENT, and CUSTOM_EVENT are sent directly through Branch’s Webhook and Treasure Data Postback API.
- To configure, go to Data Feeds > Data Integration > Treasure Data in the Branch Console.
- Input your Treasure Data Write-Only API Key and the destination database.
This approach is currently supported only for the US region.
For events not covered by Approach 1 (example, ADD_TO_CART events or if your Treasure Data instance is located in the EU01 region or others), you will need to set up a custom webhook. This integration allows you to collect the same data as the partner integration.
WEBHOOK URL menu allows you to enter the URL where you would like the events to be sent. This URL can be written in the Free Form Edit option.
- Use the Webhook URL field to specify where you want Branch events sent. Customize this in the Free Form Edit option.
- Select the appropriate Treasure Data regional ingest endpoint:
- US Region: https://in.treasuredata.com/postback/v3/event/<database_name>/<table_name>
- EU01 Region: https://eu01.in.treasuredata.com/postback/v3/event/<database_name>/<table_name>
- Tokyo Region: https://tokyo.in.treasuredata.com/postback/v3/event/<database_name>/<table_name>
- Korea Region: https://ap02.in.treasuredata.com/postback/v3/event/<database_name>/<table_name>
- AP03 Region: https://ap03.in.treasuredata.com/postback/v3/event/<database_name>/<table_name>
- Replace <database_name> and <table_name> with your desired database and table names in Treasure Data.
See Treasure Data Postback API Documentation for further details.
Use the POST method for all trigger events.
In the HEADERS section, include the following parameters:
| Key | Value |
|---|---|
| Content-Type | application/json |
| X-TD-Write-Key | Your WRITE APIKEY |
Treasure Data expects the data to be in JSON format. You can also use Branch's macro feature for custom data syntax if needed. It is recommended to test event ingestion before going live.
To verify data ingestion (ex. iOS):
- Branch provides an iOS sample code. You can use this sample code with your test API key to send events from a real or simulated iPhone device.
- Check the Recent Records section in Treasure Data for the events sent. Data will typically appear within 3-5 minutes.
- Create a query in Treasure Data to verify the events.
Q. What is the “time” column in the table? A. Treasure Data automatically adds a UNIX timestamp when the incoming event does not include a time field. This timestamp represents when the event request was received by the Treasure Data server.
Q. How can we stitch users across Treasure Data and Branch? A. Treasure Data recommends including your CRM ID, email, or other identifiers using Branch’s user tracking feature. This allows for unified identity resolution across Treasure Data and Branch. See Branch User Tracking Documentation for more information.
Q. Do I need to configure an IP whitelist for Webhook? A. No, Treasure Data's Postback endpoint does not require IP whitelisting.
Q. How can I parse JSON fields in a column? A. Using Trino, you can extract JSON data with the following query example:
SELECT
JSON_EXTRACT_SCALAR(JSON_PARSE(event_data), '$.currency') AS currency
FROM
add_cart_live;