# AppsFlyer for Advocate — Technical Reference

Your Advocate program can integrate with AppsFlyer.

This technical reference explains the specific fields, features, and functionality that is used in the integration. Just getting started? Learn how to [integrate AppsFlyer with Advocate](https://integrations.impact.com/impact-brand/docs/appsflyer-integration).

## Link handling behaviors

After the AppsFlyer integration is configured, link-handling behaviors will change.

Advocate will create AppsFlyer links dynamically by passing custom attribution parameters to the link provided in your AppsFlyer configuration. Data is passed using the `deep_link_sub1` through `deep_link_sub7` URL parameters. You can use `deep_link_sub1` or `_advocate` (depending on your deep linking) to attribute referrals, and the other parameters to customize the mobile landing experience.

We will redirect all link clicks through AppsFlyer. Mobile users will be directed by AppsFlyer according to your OneLink configuration and desktop users will be directed to the landing page URL you configured for your referral program. Advocate passes this URL through the `af_web_dp` parameter. If you set the value for `af_web_dp` in AppsFlyer it will overwrite the value configured for your referral program.

{% hint style="warning" %}
**Important:** If you have both Branch Metrics and AppsFlyer integrations enabled, share links will still be redirected to AppsFlyer links. However, the Branch deep link will be passed to the AppsFlyer integration instead of your landing page link. In effect, both integrations are applied—Branch first, then AppsFlyer.
{% endhint %}

## Data fields <a href="#data-fields" id="data-fields"></a>

| Field            | Type   | Description                                                                                                                                                                                                                                                                 |
| ---------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pid`            | string | Media source, set as `saasquatch_int` in AppsFlyer when configuring your custom attribution link.                                                                                                                                                                           |
| `c`              | string | Campaign name, set as `saasquatch` in AppsFlyer when configuring your custom attribution link.                                                                                                                                                                              |
| `af_web_dp`      | string | The URL where desktop users will be redirected. Set this as the landing page for your Advocate program in impact.com. Do not configure a value for this parameter when creating your custom link in AppsFlyer.                                                              |
| `deep_link_sub1` | string | The Base64URL encoded attribution cookie values. This is necessary to attribute the referral. When decoded, the schema will resemble the following: `{"app.referralsaasquatch.com": {"tenantAlias_CODE": {"codes": {"program1": "CODE1"},"codesExp": {"CODE1": 1234567}}}}` |
| `deep_link_sub2` | string | Google Analytics-compatible traffic source identifier.                                                                                                                                                                                                                      |
| `deep_link_sub3` | string | Google Analytics-compatible advertising or marketing medium.                                                                                                                                                                                                                |
| `deep_link_sub4` | string | Google Analytics-compatible campaign name.                                                                                                                                                                                                                                  |
| `deep_link_sub5` | string | The customer advocate's referral code.                                                                                                                                                                                                                                      |
| `deep_link_sub6` | string | The medium through which the customer advocate shared their referral (e.g. Facebook share button).                                                                                                                                                                          |
| `deep_link_sub7` | string | The medium from which the customer advocate engaged with the referral program (e.g. embedded widget).                                                                                                                                                                       |

## Example Deep Link <a href="#example-deep-link" id="example-deep-link"></a>

When Advocate creates links dynamically in AppsFlyer, the link and its custom attribution parameters will look similar to the following example.

{% tabs %}
{% tab title="JSON" %}

```json
{
  "pid": "saasquatch_int",
  "c": "saasquatch",
  "af_web_dp": "http://myReferralLandingPage.com",
  "utm_source": "invite",
  "utm_medium": "link",
  "utm_campaign": "saasquatch",
  "rsCode": "REFERRALCODE",
  "rsShareMedium": "UNKNOWN",
  "rsEngagementMedium": "UNKNOWN",
  "_saasquatch": "eyJhcHAucmVmZXJyYWxzYWFzcXVhdGNoLmNvbSI6eyJ0ZXN0XzEyMzQ1NjdfQ09ERSI6eyJjb2RlcyI6eyJyZWZlcnJhbCI6IlJFRkVSUkFMQ09ERSJ9LCJjb2Rlc0V4cCI6eyJSRUZFUlJBTENPREUiOjE2Mjk1ODIxOTl9LCJsaW5rcyI6eyJyZWZlcnJhbCI6Imh0dHBzOi8vc3NxdC5jby9temFBMjIifSwibGlua3NFeHAiOnsiaHR0cHM6Ly9zc3F0LmNvL216YUEyMiI6MTYyOTU4MjE5OX19fX0="
}
```

{% endtab %}
{% endtabs %}


---

# 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/advocate/mobile-options-for-advocate/appsflyer-for-advocate/appsflyer-for-advocate-technical-reference.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.
