> For the complete documentation index, see [llms.txt](https://docs.customerglu.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.customerglu.com/miscellaneous-topics/referrals/branch.md).

# Branch

### Setting up deep link in Branch

* Sign in to your branch.io dashboard
* Enter your preferred domain name & click Next

![](https://paper-attachments.dropbox.com/s_679F188725FEA579B41AF04611AE49D582B96A96F8BAFA5E80DF2855C2E73BB2_1628677775513_image.png)

* Fill the required details about your website iOS/Android app etc. and click Next

![](https://paper-attachments.dropbox.com/s_679F188725FEA579B41AF04611AE49D582B96A96F8BAFA5E80DF2855C2E73BB2_1628677476449_image.png)

* You can now see your first deep link automatically, generated by BranchIO, click on next and it will redirect you to the dashboard

![](https://paper-attachments.dropbox.com/s_679F188725FEA579B41AF04611AE49D582B96A96F8BAFA5E80DF2855C2E73BB2_1628677852882_image.png)

* Click on the Configuration on left sidebar and scroll down to link domain section & copy the link under **Default Link Domain** & share it with CustomerGlu

![](https://paper-attachments.dropbox.com/s_679F188725FEA579B41AF04611AE49D582B96A96F8BAFA5E80DF2855C2E73BB2_1628678983832_image.png)

* Click on the Account Settings on left sidebar and under Profile tab in Branch Key and Secret section, copy the key & share it with CustomerGlu

![](https://paper-attachments.dropbox.com/s_679F188725FEA579B41AF04611AE49D582B96A96F8BAFA5E80DF2855C2E73BB2_1628679495773_image.png)

* Share following with CustomerGlu:
  * **branchKey**
  * **og\_title**: for meta/preview //optional
  * **og\_description**: for meta/preview //optional     &#x20;
  * **og\_image\_url**: for meta/preview //optional     &#x20;
  * **og\_url**: for meta/preview //optional     &#x20;
  * **desktop\_url**: Website Link     &#x20;
  * **ios\_url**: Appstore Link     &#x20;
  * **android\_url**: playStore Link

### Processing referral link from devices

\
Please refer to the following documentation for receiving and processing the referral links\
Android: <https://help.branch.io/developers-hub/docs/android-advanced-features#read-deep-link>\
iOS: <https://help.branch.io/developers-hub/docs/ios-advanced-features#read-deep-link>\
\
The referral link encodes the userId and referralCode information and the same can be extracted from the link to be passed on to CustomerGlu while registering a new user.<br>

### referredBy

Store the referrer userId information and pass it as **referredBy** property in the device registration call for the new user:

```json
{
    "userId": "<new-user-Id>",
    "deviceId": "asd",
    "deviceName": "TestDevice",
    "deviceType": "android",
    "writeKey": "write-key",
    "firebaseToken": "firebase-token",
    "referredBy": "referrerUserId"
}
```

Note: On installation where there is no referrer, you need not send referredBy property in the call

### referralCode

Store the referral code information and pass it as **referralCode** property in the device registration call for the new user:

```json
{
    "userId": "<new-user-Id>",
    "deviceId": "asd",
    "deviceName": "TestDevice",
    "deviceType": "android",
    "writeKey": "write-key",
    "firebaseToken": "firebase-token",
    "referralCode": "ABC-123"
}
```

Note: On installation where there is no referrer, you need not send referralCode property in the call


---

# 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://docs.customerglu.com/miscellaneous-topics/referrals/branch.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.
