> For the complete documentation index, see [llms.txt](https://doc.commandersact.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.commandersact.com/features/destinations/destinations-catalog/branch-events.md).

# Branch Events

[Branch](https://www.branch.io/) (formerly known as Branch Metrics) is a mobile software company focused on mobile deep linking and attribution. This integration allows [server-side event tracking](https://help.branch.io/developers-hub/reference/events-api).

## Key features

The Branch Events destination provides the following key features:

* **Events structure**: our [Events reference](https://doc.commandersact.com/developers/tracking/events-reference) matches Branch [standard](https://help.branch.io/developers-hub/reference/logstandardevents) and [custom events](https://help.branch.io/developers-hub/reference/logcustomevents), meaning that your data is properly bridged to the expected fields in an optimized way.
* **Prebuilt mappings**: data mapping for event-based destinations happens automatically, which simplifies user inputs.
* **Refined data**: you can freely push additional information based on your specific needs (E.g. adding custom events and custom event properties).
* **Smart mapping**: data mapping can be readjusted using your datalayer defined fields.
* **Event mapping**: change standard mapping between your partners' events and yours or add new mappings.
* **Support for multi-item data**: information included in the [item](https://doc.commandersact.com/developers/tracking/events-reference#item) array is dispatched to Branch.

## Destination setup

{% hint style="info" %}
Before configuring this destination, you need to create a [Branch Dashboard](https://dashboard.branch.io/).
{% endhint %}

### Configuration

<table><thead><tr><th width="300">Settings</th><th>Description</th></tr></thead><tbody><tr><td><code>Branch Key</code></td><td><em><strong><code>Required</code></strong></em><br>Branch Key of the originating app and obtained by accessing your <a href="https://help.branch.io/using-branch/docs/profile-settings">Account Settings</a>.</td></tr><tr><td><code>Content Schema</code></td><td>Category/Schema for the included content.</td></tr><tr><td><code>Custom Event Properties</code></td><td>Map your custom event properties by setting their field names in <code>Branch property name</code> and adding the field name holding the value in <code>Your event property</code>.</td></tr><tr><td><code>Event Mapping</code></td><td>Change the standard mapping (See <a href="#quick-reference">Quick reference</a>) between Branch's events and yours or add new mappings.</td></tr></tbody></table>

## Quick reference

<table data-header-hidden="false" data-header-sticky><thead><tr><th>Commanders Act Events</th><th>Branch Events</th></tr></thead><tbody><tr><td><code>achieve_level</code></td><td><code>ACHIEVE_LEVEL</code></td></tr><tr><td><code>add_payment_info</code></td><td><code>ADD_PAYMENT_INFO</code></td></tr><tr><td><code>add_to_cart</code></td><td><code>ADD_TO_CART</code></td></tr><tr><td><code>add_to_wishlist</code></td><td><code>ADD_TO_WISHLIST</code></td></tr><tr><td><code>begin_checkout</code></td><td><code>INITIATE_PURCHASE</code></td></tr><tr><td><code>click_ad</code></td><td><code>CLICK_AD</code></td></tr><tr><td><code>complete_stream</code></td><td><code>COMPLETE_STREAM</code></td></tr><tr><td><code>complete_tutorial</code></td><td><code>COMPLETE_TUTORIAL</code></td></tr><tr><td><code>generate_lead</code></td><td><code>COMPLETE_REGISTRATION</code></td></tr><tr><td><code>initiate_stream</code></td><td><code>INITIATE_STREAM</code></td></tr><tr><td><code>invite</code></td><td><code>INVITE</code></td></tr><tr><td><code>login</code></td><td><code>LOGIN</code></td></tr><tr><td><code>purchase</code></td><td><code>PURCHASE</code></td></tr><tr><td><code>rate</code></td><td><code>RATE</code></td></tr><tr><td><code>search</code></td><td><code>SEARCH</code></td></tr><tr><td><code>share</code></td><td><code>SHARE</code></td></tr><tr><td><code>start_trial</code></td><td><code>START_TRIAL</code></td></tr><tr><td><code>spend_credits</code></td><td><code>SPEND_CREDITS</code></td></tr><tr><td><code>subscribe</code></td><td><code>SUBSCRIBE</code></td></tr><tr><td><code>unlock_achievement</code></td><td><code>UNLOCK_ACHIEVEMENT</code></td></tr><tr><td><code>view_ad</code></td><td><code>VIEW_AD</code></td></tr><tr><td><code>view_cart</code></td><td><code>VIEW_CART</code></td></tr><tr><td><code>view_item</code></td><td><code>VIEW_ITEM</code></td></tr><tr><td><code>view_items</code></td><td><code>VIEW_ITEMS</code></td></tr><tr><td><code>[Any Event]</code> <strong>[1]</strong></td><td><code>[Any Event]</code> <strong>[1]</strong></td></tr></tbody></table>

{% hint style="info" %}
**1.** See <mark style="color:blue;">`Event Mapping`</mark> in [Configuration](#configuration) for more details.
{% endhint %}

## Field mappings

{% hint style="warning" %}
At least one of the following must be included:\
• <mark style="color:blue;">`developer_identity`</mark>\
• <mark style="color:blue;">`browser_fingerprint_id`</mark>\
• <mark style="color:blue;">`idfa`</mark> OR <mark style="color:blue;">`idfv`</mark> (IF <mark style="color:blue;">`os`</mark> = <mark style="color:blue;">`iOS`</mark> )\
• <mark style="color:blue;">`aaid`</mark> OR <mark style="color:blue;">`android_id`</mark> (IF <mark style="color:blue;">`os`</mark> = <mark style="color:blue;">`Android`</mark> )
{% endhint %}

{% hint style="info" %}
Properties can be remapped using our [Smart Mapping](https://doc.commandersact.com/features/destinations/advanced-mapping#smart-mapping) feature.
{% endhint %}

<table data-header-hidden="false" data-header-sticky><thead><tr><th width="281">Smart Mapping Fields</th><th width="342.6685580062746">Commanders Act Default Properties</th><th width="275.3314419937253">Branch Properties</th></tr></thead><tbody><tr><td><code>-</code></td><td><code>Branch Key</code></td><td><code>branch_key</code></td></tr><tr><td><code>Customer Event Alias</code></td><td><code>partners.branch.event_alias</code></td><td><code>customer_event_alias</code></td></tr><tr><td><code>Device OS</code></td><td><code>context.device.os.name</code></td><td><code>os</code> <strong>[1]</strong></td></tr><tr><td><code>Device OS Version</code></td><td><code>context.device.os.version</code></td><td><code>os_version</code> <strong>[1]</strong></td></tr><tr><td><code>Environment</code></td><td><code>partners.branch.env</code></td><td><code>environment</code> <strong>[1]</strong></td></tr><tr><td><code>Device Mobile Identifier</code></td><td><code>context.device.advertising_id</code></td><td><p><code>idfa</code> <strong>[1][5]</strong></p><p><code>aaid</code> <strong>[1][6]</strong></p></td></tr><tr><td><code>Android Hardware Id</code></td><td><code>partners.branch.hardware_id</code></td><td><code>android_id</code> <strong>[1]</strong></td></tr><tr><td><code>Device iOS IDFV</code></td><td><code>context.device.idfv</code></td><td><code>idfv</code> <strong>[1]</strong></td></tr><tr><td><code>Ad Tracking Enabled</code></td><td><code>context.device.ad_tracking_enabled</code></td><td><code>limit_ad_tracking</code> <strong>[1][7]</strong></td></tr><tr><td><code>Device User Agent</code></td><td><code>context.device.user_agent</code></td><td><code>user_agent</code> <strong>[1]</strong></td></tr><tr><td><code>Branch Browser Fingerprint Id</code></td><td><code>partners.branch.fingerprint_id</code></td><td><code>browser_fingerprint_id</code> <strong>[1]</strong></td></tr><tr><td><code>Page URL</code></td><td><code>context.page.url</code></td><td><code>http_origin</code> <strong>[1]</strong></td></tr><tr><td><code>Page Referrer URL</code></td><td><code>context.page.referrer</code></td><td><code>http_referrer</code> <strong>[1]</strong></td></tr><tr><td><code>User Id</code></td><td><code>user.id</code></td><td><code>developer_identity</code> <strong>[1]</strong></td></tr><tr><td><code>User Country</code></td><td><code>user.country</code></td><td><code>country</code> <strong>[1]</strong></td></tr><tr><td><code>User Language</code></td><td><code>context.page.lang</code></td><td><code>language</code> <strong>[1]</strong></td></tr><tr><td><code>Device IP</code></td><td><code>context.device.ip</code></td><td><code>ip</code> <strong>[1]</strong></td></tr><tr><td><code>Device Local IP</code></td><td><code>partners.branch.local_ip</code></td><td><code>local_ip</code> <strong>[1]</strong></td></tr><tr><td><code>Device Brand</code></td><td><code>context.device.manufacturer</code></td><td><code>brand</code> <strong>[1]</strong></td></tr><tr><td><code>Branch Device Token</code></td><td><code>partners.branch.device_token</code></td><td><code>randomized_device_token</code> <strong>[1]</strong></td></tr><tr><td><code>App Version</code></td><td><code>context.app.version</code></td><td><code>app_version</code> <strong>[1]</strong></td></tr><tr><td><code>Device Model</code></td><td><code>context.device.model</code></td><td><code>model</code> <strong>[1]</strong></td></tr><tr><td><code>Device DPI</code></td><td><code>context.device.screen.density</code></td><td><code>screen_dpi</code> <strong>[1]</strong></td></tr><tr><td><code>Device Screen Width</code></td><td><code>context.device.screen.width</code></td><td><code>screen_width</code> <strong>[1]</strong></td></tr><tr><td><code>Device Screen Height</code></td><td><code>context.device.screen.height</code></td><td><code>screen_height</code> <strong>[1]</strong></td></tr><tr><td><code>DMA EEA</code></td><td><code>partners.branch.dma_eea</code></td><td><code>dma_eea</code> <strong>[1]</strong></td></tr><tr><td><code>DMA Ad Personalization</code></td><td><code>partners.branch.dma_ad_pers</code></td><td><code>dma_ad_personalization</code> <strong>[1]</strong></td></tr><tr><td><code>DMA Ad User Data</code></td><td><code>partners.branch.dma_ad_user_data</code></td><td><code>dma_ad_user_data</code> <strong>[1]</strong></td></tr><tr><td><code>Transaction Id</code></td><td><code>id</code></td><td><code>transaction_id</code> <strong>[2]</strong></td></tr><tr><td><code>Transaction Revenue</code></td><td><code>revenue</code></td><td><code>revenue</code> <strong>[2]</strong></td></tr><tr><td><code>Currency</code></td><td><code>currency</code></td><td><code>currency</code> <strong>[2]</strong></td></tr><tr><td><code>Shipping Amount</code></td><td><code>shipping_amount</code></td><td><code>shipping</code> <strong>[2]</strong></td></tr><tr><td><code>Tax Amount</code></td><td><code>tax_amount</code></td><td><code>tax</code> <strong>[2]</strong></td></tr><tr><td><code>Transaction Coupon</code></td><td><code>coupon</code></td><td><code>coupon</code> <strong>[2]</strong></td></tr><tr><td><code>Transaction Type</code></td><td><code>type</code></td><td><code>affiliation</code> <strong>[2]</strong></td></tr><tr><td><code>Transaction Description</code></td><td><code>event_name</code></td><td><code>description</code> <strong>[2]</strong></td></tr><tr><td><code>Search Term</code></td><td><code>search_query</code></td><td><code>search_term</code> <strong>[2]</strong></td></tr><tr><td><code>-</code></td><td><code>Content Schema</code></td><td><code>$content_schema</code> <strong>[3]</strong></td></tr><tr><td><code>Item Title</code></td><td><code>item_title</code> <strong>[4]</strong></td><td><code>$og_title</code> <strong>[3]</strong></td></tr><tr><td><code>Item Image URL</code></td><td><code>product.image_url</code> <strong>[4]</strong></td><td><code>$og_image_url</code> <strong>[3]</strong></td></tr><tr><td><code>Item Canonical Identifier</code></td><td><code>product.canonical_identifier</code> <strong>[4]</strong></td><td><code>$canonical_identifier</code> <strong>[3]</strong></td></tr><tr><td><code>Item Publicly Indexable</code></td><td><code>product.publicly_indexable</code> <strong>[4]</strong></td><td><code>$publicly_indexable</code> <strong>[3]</strong></td></tr><tr><td><code>Item Publicly Indexable</code></td><td><code>product.locally_indexable</code> <strong>[4]</strong></td><td><code>$locally_indexable</code> <strong>[3]</strong></td></tr><tr><td><code>Item Price</code></td><td><code>product.price</code> <strong>[4]</strong></td><td><code>$price</code> <strong>[3]</strong></td></tr><tr><td><code>Item Quantity</code></td><td><code>quantity</code> <strong>[4]</strong></td><td><code>$quantity</code> <strong>[3]</strong></td></tr><tr><td><code>Item Id</code></td><td><code>id</code> <strong>[4]</strong></td><td><code>$sku</code> <strong>[3]</strong></td></tr><tr><td><code>Item Name</code></td><td><code>product.name</code> <strong>[4]</strong></td><td><code>$product_name</code> <strong>[3]</strong></td></tr><tr><td><code>Item Brand</code></td><td><code>product.brand</code> <strong>[4]</strong></td><td><code>$product_brand</code> <strong>[3]</strong></td></tr><tr><td><code>Item Category</code></td><td><code>product.category_1</code> <strong>[4]</strong></td><td><code>$product_category</code> <strong>[3]</strong></td></tr><tr><td><code>Item Variant</code></td><td><code>variant</code> <strong>[4]</strong></td><td><code>$product_variant</code> <strong>[3]</strong></td></tr><tr><td><code>Item Rating Average</code></td><td><code>product.rating_average</code> <strong>[4]</strong></td><td><code>$rating_average</code> <strong>[3]</strong></td></tr><tr><td><code>Item Rating Count</code></td><td><code>product.rating_count</code> <strong>[4]</strong></td><td><code>$rating_count</code> <strong>[3]</strong></td></tr><tr><td><code>Item Rating Max</code></td><td><code>product.rating_max</code> <strong>[4]</strong></td><td><code>$rating_max</code> <strong>[3]</strong></td></tr><tr><td><code>Item Creation Timestamp</code></td><td><code>product.creation_timestamp</code> <strong>[4]</strong></td><td><code>$creation_timestamp</code> <strong>[3]</strong></td></tr><tr><td><code>Item Expiration Date</code></td><td><code>product.exp_date</code> <strong>[4]</strong></td><td><code>$exp_date</code> <strong>[3]</strong></td></tr><tr><td><code>Item Keywords</code></td><td><code>product.keywords</code> <strong>[4]</strong></td><td><code>$keywords</code> <strong>[3]</strong></td></tr><tr><td><code>Item Address Street</code></td><td><code>product.address_street</code> <strong>[4]</strong></td><td><code>$address_street</code> <strong>[3]</strong></td></tr><tr><td><code>Item Address City</code></td><td><code>product.address_city</code> <strong>[4]</strong></td><td><code>$address_city</code> <strong>[3]</strong></td></tr><tr><td><code>Item Address Region</code></td><td><code>product.address_region</code> <strong>[4]</strong></td><td><code>$address_region</code> <strong>[3]</strong></td></tr><tr><td><code>Item Address Country</code></td><td><code>product.address_country</code> <strong>[4]</strong></td><td><code>$address_country</code> <strong>[3]</strong></td></tr><tr><td><code>Item Address Postal Code</code></td><td><code>product.address_postal_code</code> <strong>[4]</strong></td><td><code>$address_postal_code</code> <strong>[3]</strong></td></tr><tr><td><code>Item Latitude</code></td><td><code>product.latitude</code> <strong>[4]</strong></td><td><code>$latitude</code> <strong>[3]</strong></td></tr><tr><td><code>Item Longitude</code></td><td><code>product.longitude</code> <strong>[4]</strong></td><td><code>$longitude</code> <strong>[3]</strong></td></tr><tr><td><code>Item Image Captions</code></td><td><code>product.image_captions</code> <strong>[4]</strong></td><td><code>$image_captions</code> <strong>[3]</strong></td></tr><tr><td><code>Item Condition</code></td><td><code>product.condition</code> <strong>[4]</strong></td><td><code>$condition</code> <strong>[3]</strong></td></tr></tbody></table>

{% hint style="info" %}
**1.** Set in <mark style="color:blue;">`user_data`</mark> .\
**2.** Set in <mark style="color:blue;">`event_data`</mark> .\
**3.** Set in <mark style="color:blue;">`content_items.X`</mark> .\
**4.** Set in <mark style="color:blue;">`items.X`</mark> .\
**5.** property set when <mark style="color:blue;">`context.device.os.name`</mark> is <mark style="color:blue;">`iOS`</mark> (case insensitive).\
**6.** property set when <mark style="color:blue;">`context.device.os.name`</mark> is <mark style="color:blue;">`Android`</mark> (case insensitive).\
**7.** boolean opposite of <mark style="color:blue;">`context.device.ad_tracking_enabled`</mark> .
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://doc.commandersact.com/features/destinations/destinations-catalog/branch-events.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
