Raw-Data Access to Branch Metrics Events

Branch Metrics is linking infrastructure for today’s top brands. If you use Branch Metrics to manage your mobile advertising campaigns, you can now leverage the Branch Metrics to Treasure Data webhook integration to bring in your mobile data into Treasure Data.

Every time these events occur in mobile devices, it will be notified to Branch Metrics, and then to Treasure Data. Treasure Data stores all historical raw events for your analysis.

Table of Contents

Generate Treasure Data Write-only API Key

Treasure Data requires Write-only API Key for authentication when you import data.

After clicking the “My Profile” which is located at bottom left of the screen at https://console.treasuredata.com/, please click API Key tab and generate “Write-only” API keys.

Postback setup within Branch Metrics Console

Then, let’s setup webhook configuration from Branch Metrics. In this way, everytime events got captured within Branch Metrics, these events will be forwarded to Treasure Data in realtime.

First, open Webhooks page and click Add a new webhook.

Then, please use the following URL for the endpoint. This leverages our REST Import API endpoint with GET method.

 https://in.treasuredata.com/postback/v3/event/<database_name>/<table_name>?td_write_key=<TD_API_WRITE_KEY>&event_name={{event.name}}&clickId={{session.link_click.query.clickId}}&hardware_id={{device.hardware_id}}&event_date={{event.date}}&link_id={{click.link_data.~id}}&link_campaign={{click.link_data.~campaign}}&link_channel={{click.link_data.~channe}}&link_feature={{click.link_data.~feature}}&link_stage={{click.link_data.~stage}}
  • TD_API_WRITE_KEY: Treasure Data’s write key. You can get the write key from your Treasure Data console(see Get the API Key). Please do not to forget URL encodiing.
  • database_name: Database name in Treasure Data you would like to send data.
  • table_name: Table name in Treasure Data you would like to send data.

The example URL is like following.

http://in.treasuredata.com/postback/v3/event/branchio/click?td_write_key=321%1234567890abcdefghijklmnopqrstuvwxyz&event_name={{event.name}}clickId={{session.link_click.query.clickId}}&hardware_id={{device.hardware_id}}&event_date={{event.date}}&link_id={{click.link_data.~id}}&link_campaign={{click.link_data.~campaign}}&link_channel={{click.link_data.~channe}}&&link_feature={{click.link_data.~feature}}&&link_stage={{click.link_data.~stage}}

There’s a LOT more keys available on Branch Metrics. Please check the documentation here.

Testing

Now please send a couple of events. Then, for each configure webhook, you can see Recent Records section. It will take 3-5 minutes to appear events on Treasure Data.

Further Readings

Please contact us for details.


Last modified: Apr 28 2017 10:01:25 UTC

If this article is incorrect or outdated, or omits critical information, please let us know. For all other issues, please see our support channels.