# Integrate with Branch

If you're using Branch to manage links & routing to your app(s), you can integrate it with impact.com to track, report, and pay out on various events.

{% hint style="success" %}
**Note:** This article covers the Integration with Branch for a Performance Program. Learn more about how to [Integrate with Branch for your Advocate Program](https://integrations.impact.com/impact-brand/docs/branch-metrics-integration).
{% endhint %}

#### How it works

* In the Branch dashboard, you'll add impact.com as an *Ad Partner* to your account, which enables the standard postbacks. Additional postbacks can be configured to suit your use case.
* Once integrated, you'll create a Branch *Ad Link*, append a necessary query string parameter, then set it as your mobile app(s)'s *Download URL* in the impact.com platform.
* From there, you'll be able to test the integration with a test ad that will forward a user to your app's Branch *Ad Link*. Events that you've configured in the integration and occur in your app will appear as *Actions* in the impact.com platform.

{% hint style="success" %}
**Note:** This guide assumes a developer has already implemented the Branch SDK in your app(s) and completed the *Universal Ads* prerequisite — [learn more](https://help.branch.io/using-branch/page/impact).
{% endhint %}

## Enable the integration

***

1. In the Branch dashboard, select **Ads → Partner Management**.
2. In the Ad Partners sidebar, search for `impact`.
3. Under *More Ad Partners*, select **Impact**.
4. In the *Ad Account Information panel*, add your impact.com account info:<br>

   | **iOS Tracker**           | Input the System App ID of your iOS app. In the impact.com platform, navigate to your [Mobile Apps](https://app.impact.com/secure/advertiser/tracking-settings/mobileapps/view-mobile-apps-flow.ihtml) to find your System App ID.     |
   | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **Android Tracker**       | Input the System App ID of your Android app. In the impact.com platform, navigate to your [Mobile Apps](https://app.impact.com/secure/advertiser/tracking-settings/mobileapps/view-mobile-apps-flow.ihtml) to find your System App ID. |
   | **Impact Account SID \*** | In the impact.com platform, navigate to your [API Credentials](https://help.impact.com/en/support/solutions/articles/155000004762-manage-api-access-tokens-as-a-brand#get-your-api-credentials-0-1) to find your Account SID.          |
   | **Auth Token \***         | In the impact.com platform, navigate to your [API Credentials](https://help.impact.com/en/support/solutions/articles/155000004762-manage-api-access-tokens-as-a-brand#get-your-api-credentials-0-1) to find your Auth Token.           |
5. Select **Save & Enable**.

## Create Branch Ad Link for impact.com

***

Once the integration is enabled and you've configured postbacks, [**Create a Branch Ad Link**](https://help.branch.io/using-branch/docs/ad-links).

{% hint style="success" %}
**Note:** When creating your ad link, make sure to select **Impact as the Ad Partner** to ensure the correct query string parameters are appended.
{% endhint %}

### Update Download URL in impact.com

This section assumes you've already set up an app. See [**Set up Mobile App Tracking**](https://help.impact.com/en/support/solutions/articles/48001237444-set-up-a-mobile-app) in the impact.com Help Center for details on configuring a mobile app.

Configure your newly created *Branch Ad Link* as the *Download URL* for your app in impact.com.

1. In the impact.com platform, from the top navigation bar, select ![](/files/qPLiENtq33ewHc3tmEP4) **\[User profile] → Settings**.
2. In the right column, select [**Mobile Apps**](https://app.impact.com/secure/advertiser/tracking-settings/mobileapps/view-mobile-apps-flow.ihtml).
3. In the list, find the mobile app that you want to modify and select ![](https://res.cloudinary.com/product-enablement/image/upload/v1768910844/Accessibility%20Icons/More_vNext.svg) **\[More] → View/Edit**.
4. Find the Download URL line item and **paste in the Ad Link** from Branch, making sure that all query string parameters are present.

## Integration options

***

### Postback config

The *Postback Config* screen is where you can manage the postbacks that Branch is sending to impact.com. Refer to the Postback templates section for common use case examples — the templates can be easily modified with the parameters you want impact.com to receive.

#### Postback templates

For each example, a parameter denoted in brackets indicates this is a value or variable that you need to add in order for the postback to work.

| Parameter               | Description                                                            |
| ----------------------- | ---------------------------------------------------------------------- |
| `[AccountSID]`          | Your impact.com Account SID value.                                     |
| `[AuthToken]`           | Your impact.com Auth Token value.                                      |
| `[iOS_SystemAppID]`     | For iOS apps, the impact.com System App ID.                            |
| `[Android_SystemAppID]` | For Android apps, the impact.com System App ID.                        |
| `[UUID_Value]`          | If available, the UUID value that the Branch SDK assigns to a user.    |
| `[ProgramId]`           | Your impact.com Program ID.                                            |
| `[EventTypeId]`         | Your impact.com Event Type ID.                                         |
| `[EventCode]`           | If the event type is using event codes, the case-sensitive event code. |

{% hint style="info" %}
**Tip:** For documentation on API calls, see the API Reference section for the PageLoad and Conversions endpoints.
{% endhint %}

**App Open**

{% tabs %}
{% tab title="App Open" %}

```json
https://trkapi.impact.com/PageLoad?CampaignId=[ProgramID]&PageUrl=${(last_attributed_touch_data.$original_url)!}&CustomProfileId=[UUID_Value]&EventDate=2024-08-01T23:55:24-08:00&AndroidId=${(user_data.android_id)!}&AppleIfa=${ (user_data.idfa)! }&GoogAId=${ (user_data.aaid)! }&ImpactAppId=<@loop data=app.app_bundles val="bundle"><#if user_data.os == bundle.os><#if bundle.os=="IOS">[iOS_SystemAppID]<#elseif bundle.os == "ANDROID">[Android_SystemAppID]</#if><@break/></#if></@loop>
```

{% endtab %}
{% endtabs %}

**App Install / Reinstall (Basic Auth Required)**

{% tabs %}
{% tab title="App Install / Reinstall (Basic Auth Required)" %}

```json
https://[AccountSID]:[AuthToken]@api.impact.com/Advertisers/[AccountSID]/Conversions/?ActionTrackerId=<@loop data=app.app_bundles val="bundle"><#if user_data.os == bundle.os><#if bundle.os=="IOS">[iOS_SystemAppID]<#elseif bundle.os == "ANDROID">[Android_SystemAppID]</#if><@break/></#if></@loop>&AppPackage=<@loop data=app.app_bundles val="bundle"><#if user_data.os == bundle.os><#if bundle.os == "IOS"><@break/><#elseif bundle.os == "ANDROID">${(bundle.android.package_name)!}</#if><@break/></#if></@loop>&AppName=${ (app.name)!}&EventDate=2024-08-01T23:55:24-08:00&EventCode=INSTALL&AndroidId=${(user_data.android_id)!}&AppleIfa=${(user_data.idfa)!}&GoogAId=${(user_data.aaid)!}&AppInstallRef=${(last_attributed_touch_data.AppInstallRef)!}&DeviceOs=${(user_data.os)!}&DeviceOSVer=${(user_data.os_version)!}&IpAddress=${(user_data.ip)!}&ClickId=${(last_attributed_touch_data.~click_id)!}&Oid=${(id)!}&CampaignId=[ProgramId]&CustomProfileId=[UUID_Value]&subID1=${(last_attributed_touch_data.subID1)!}&subID2=${(last_attributed_touch_data.subID2)!}&subID3=${(last_attributed_touch_data.subID3)!}&ShareId=${(last_attributed_touch_data.ShareId)!}&IntegrationSource=BRANCH
```

{% endtab %}
{% endtabs %}

**Lead (Basic Auth Required)**

{% tabs %}
{% tab title="Lead (Basic Auth Required)" %}

```json
https://${ (ad_network.credentials.Account_SID)!}:${ (ad_network.credentials.Authorization_Token)! }@api.impactradius.com/Advertisers/${ (ad_network.credentials.Account_SID)! }/Conversions/?CampaignId=[ProvidedByImpact]&ActionTrackerId=[ProvidedByImpact]&AppPackage=<@loop data=app.app_bundles val="bundle"><#if user_data.os == bundle.os><#if bundle.os=="IOS"><@break/><#elseif bundle.os == "ANDROID">${(bundle.android.package_name)!}</#if><@break/></#if></@loop>&Text1=<@loop data=app.app_bundles val="bundle"><#if user_data.os == bundle.os><#if bundle.os=="IOS">iOSApp<#elseif bundle.os == "ANDROID">AndroidApp</#if><@break/></#if></@loop>&IrAppId=<@loop data=app.app_bundles val="bundle"><#if user_data.os == bundle.os><#if bundle.os=="IOS">[ProvidedByImpact]<#elseif bundle.os == "ANDROID">[ProvidedByImpact]</#if><@break/></#if></@loop>&AppName=${ (app.name)! }&EventDate=2024-08-01T23:55:24-08:00&CustomProfileId=${(user_data.developer_identity)!}&AndroidId=${ (user_data.android_id)! }&AppleIfa=${ (user_data.idfa)! }&GoogAId=${ (user_data.aaid)! }&AppInstallRef=${ (last_attributed_touch_data.AppInstallRef)! }&DeviceOs=${ (user_data.os)!}&DeviceOSVer=${ (user_data.os_version)! }&IpAddress=${ (user_data.ip)! }&ClickId=${ (last_attributed_touch_data.irclickid)! }&ClickId=${ (last_attributed_touch_data.~click_id)! }&Oid=${(event_data.transaction_id)!}&subID1=${ (last_attributed_touch_data.subID1)! }&subID2=${ (last_attributed_touch_data.subID2)! }&subID3=${ (last_attributed_touch_data.subID3)! }&ShareId=${ (last_attributed_touch_data.ShareId)! }&IntegrationSource=BRANCH
```

{% endtab %}
{% endtabs %}

**Conversion (Basic Auth Required)**

{% tabs %}
{% tab title="Conversion (Basic Auth Required)" %}

```json
https://${ (ad_network.credentials.Account_SID)!}:${ (ad_network.credentials.Authorization_Token)! }@api.impactradius.com/Advertisers/${ (ad_network.credentials.Account_SID)! }/Conversions/?CampaignId=[ProvidedByImpact]&ActionTrackerId=[ProvidedByImpact]&AppPackage=<@loop data=app.app_bundles val="bundle"><#if user_data.os == bundle.os><#if bundle.os=="IOS"><@break/><#elseif bundle.os == "ANDROID">${(bundle.android.package_name)!}</#if><@break/></#if></@loop>&Text1=<@loop data=app.app_bundles val="bundle"><#if user_data.os == bundle.os><#if bundle.os=="IOS">iOSApp<#elseif bundle.os == "ANDROID">AndroidApp</#if><@break/></#if></@loop>&IrAppId=<@loop data=app.app_bundles val="bundle"><#if user_data.os == bundle.os><#if bundle.os=="IOS">[ProvidedByImpact]<#elseif bundle.os == "ANDROID">[ProvidedByImpact]</#if><@break/></#if></@loop>&AppName=${ (app.name)! }&EventDate=2024-08-01T23:55:24-08:00&CustomProfileId=${(user_data.developer_identity)!}&AndroidId=${ (user_data.android_id)! }&AppleIfa=${ (user_data.idfa)! }&GoogAId=${ (user_data.aaid)! }&AppInstallRef=${ (last_attributed_touch_data.AppInstallRef)! }&DeviceOs=${ (user_data.os)!}&DeviceOSVer=${ (user_data.os_version)! }&IpAddress=${ (user_data.ip)! }&ClickId=${ (last_attributed_touch_data.irclickid)! }&ClickId=${ (last_attributed_touch_data.~click_id)! }&Oid=${(event_data.transaction_id)!}&CustomerStatus=${(custom_data.UserType)!}&OrderPromoCode=${(event_data.coupon)!}&subID1=${ (last_attributed_touch_data.subID1)! }&subID2=${ (last_attributed_touch_data.subID2)! }&subID3=${ (last_attributed_touch_data.subID3)! }&ShareId=${ (last_attributed_touch_data.ShareId)! }&CurrencyCode=${(event_data.currency)!}&IntegrationSource=BRANCH
```

{% endtab %}
{% endtabs %}

*Item-level data*

When sending item-level conversion data to impact.com, use the following format (replacing `{variable}` in the example with the actual value without curly brackets):

{% tabs %}
{% tab title="Item-level data" %}

```json
&branch-custom=1&ItemCategory=<@urlencode><#if content_items?has_content><@loop data=content_items val="attributes"><@json>{${(attributes.$product_category)!}}</@json><@sep>,</@sep></@loop></#if></@urlencode>&ItemName=<@urlencode><#if content_items?has_content><@loop data=content_items val="attributes"><@json>{${(attributes.$product_name)!}}</@json><@sep>,</@sep></@loop></#if></@urlencode>&ItemSku=<@urlencode><#if content_items?has_content><@loop data=content_items val="attributes"><@json>{${(attributes.$sku)!}}</@json><@sep>,</@sep></@loop></#if></@urlencode>&ItemPrice=<@urlencode><#if content_items?has_content><@loop data=content_items val="attributes"><@json>{${(attributes.$price)!}}</@json><@sep>,</@sep></@loop></#if></@urlencode>&ItemQuantity=<@urlencode><#if content_items?has_content><@loop data=content_items val="attributes"><@json>{${(attributes.$quantity)!}}</@json><@sep>,</@sep></@loop></#if></@urlencode>&revenue=${(event_data.revenue_in_usd)!}
```

{% endtab %}
{% endtabs %}

*Encoded data example*

{% tabs %}
{% tab title="Encoded data example" %}

```json
branch-custom=1&ItemCategory=%22%7Btest1%7D%22%2C%22%7Btest2%7D%22%2C%22%7Btest3%7D%22&ItemSubTotal=%22%7B21.6%7D%22%2C%22%7B20%7D%22%2C%22%7B891%7D%22&ItemSku=%22%7Bsku%7D%22%2C%22%7Bsku2%7D%22%2C%22%7Bsku3%7D%22&ItemQuantity=%22%7B1%7D%22%2C%22%7B2%7D%22%2C%22%7B1%7D%22
```

{% endtab %}
{% endtabs %}

*Decoded data example*

{% tabs %}
{% tab title="Decoded data example" %}

```json
branch-custom=1&ItemCategory="{test1}","{test2}","{test3}"&ItemSubTotal="{21.6}","{20}","{891}"&ItemSku="{sku}","{sku2}","{sku3}"&ItemQuantity="{1}","{2}","{1}"
```

{% endtab %}
{% endtabs %}

### Link Parameters reference

The *Link Parameters* tab shows the default query string parameter mapping between Branch and impact.com — these are added to all generated links by default, and cannot be remapped.

| Branch Parameter    | impact.com Parameter | Description                                                                                                                                                  |
| ------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Custom Link Macro   | `{AppInstallRef}`    | Unique Install Referrer retrieved from the Google Play Store. [Learn how to retrieve this value](https://developer.android.com/google/play/installreferrer). |
| Click ID            | `{clickid}`          | impact.com token used to track the customer's journey.                                                                                                       |
| Custom Link Macro   | `{subid1}`           | First Sub-affiliate ID — query string parameter used by impact.com partners for their own reporting.                                                         |
| Custom Link Macro   | `{subid2}`           | Second Sub-affiliate ID — query string parameter used by impact.com partners for their own reporting.                                                        |
| Custom Link Macro   | `{subid3}`           | Third Sub-affiliate ID — query string parameter used by impact.com partners for their own reporting.                                                         |
| Custom Link Macro   | `{sharedid}`         | Shared ID — query string parameter used by impact.com partners that appears in your reporting.                                                               |
| Secondary Publisher | `{irmpname}`         | Name of the impact.com partner.                                                                                                                              |
| Campaign ID         | `{ircid}`            | Your impact.com Program ID value.                                                                                                                            |

### Attribution windows

The *Attribution Windows* tab is where you can customize attribution windows for the impact.com integration. impact.com also provides pre-configured attribution windows for links — select **Use ad partner attribution settings** to use the recommended settings.

[Learn more about Attribution Windows in the Branch Help Center](https://help.branch.io/using-branch/docs/attribution-windows-link-settings).

### Postback testing

The Postback Testing tab offers the ability to test your postbacks before setting them live.

Learn more about how to [Test Postbacks in the Branch Help Center](https://help.branch.io/using-branch/docs/testing-postbacks).


---

# Agent Instructions: 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:

```
GET https://integrations.impact.com/integration-guides/for-brands/plugin-integrations/mmp-mobile-measurement/integrate-with-branch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
