# Integrate Advocate with Optimize

This guide explains how to integrate Advocate activities with Optimize, ensuring that referral and advocate-driven traffic is accurately tracked and displayed in Optimize reports.

Integrating Advocate with Optimize allows you to:

* Attribute referral traffic and conversions to the Advocate channel.&#x20;
* Analyze the performance of advocate-driven campaigns alongside other marketing channels.
* Surface advocate activities in Optimize reports for better decision-making.

### Prerequisites

* [Universal Tracking Tag (UTT)](/integration-guides/for-brands/advocate/advocate-tracking-integrations/implement-with-utt-for-advocate.md) or [Page Load API](https://integrations.impact.com/impact-brand/reference/create-a-pageload) must be implemented on your website to report all referral activity to impact.com.
* Your Advocate program must be active and generating referral links.
* Access to Optimize with permissions to configure channels and rules.

### How Advocate activities are tracked in Optimize

Advocate activities are tracked in Optimize by capturing clicks and conversions that originate from [referral codes or share links](https://help.impact.com/en/support/solutions/articles/155000000935-assign-vanity-share-links-or-referral-codes) generated by your Advocate program. These activities are identified using specific URL parameters and are categorized into the appropriate channel within Optimize.

Optimize uses a combination of the following to allocate traffic to channels:

* UTM parameters (e.g., `utm_source`, `utm_medium`)
* Custom parameters (e.g., `rscode`)
* Referrer data

### Setting up Advocate as a channel in Optimize

{% stepper %}
{% step %}

#### Enable default channels

1. In the left navigation menu, select ![](/files/zm9mkdwQDEB5qaYnKweJ) **Optimize → Settings →** [**Channels**](https://app.impact.com/secure/advertiser/optimize/mediamanager/channels/list-mediasource-channels-flow.ihtml) and ensure that the *Direct* and *Organic Referral* channels are enabled.

<div data-with-frame="true"><figure><img src="/files/02eHtxtjFhqh60FKsuME" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Configure Rules to Identify (RTI) for Advocate

1. In the left navigation menu, select ![](/files/zm9mkdwQDEB5qaYnKweJ) **Optimize → Settings →** [**Channels**](https://app.impact.com/secure/advertiser/optimize/mediamanager/channels/list-mediasource-channels-flow.ihtml).
2. Select **Create Channel** or select ![](/files/QIUzi1ogqnG2NvotPFQE) **\[More] → Edit** if you already have an existing *Advocate* channel. Learn more about [creating a channel](https://help.impact.com/en/support/solutions/articles/48001239643-create-an-optimize-channel).
3. Ensure that *Identify Channel Traffic* is ![](/files/nF7DY0rLLPpjNDQb5LMS) **\[Toggled on]**.
4. In the *Rules to identify* section, define rules that capture traffic with parameters unique to Advocate referrals (see next section).

<div data-with-frame="true"><figure><img src="/files/9Hiumo5KMuCrgfEYhfgw" alt=""><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

#### Test and save your rule

* Test by generating a referral link from Advocate and clicking through to ensure the activity appears in Optimize under the correct channel.
* Select a [credit group](https://help.impact.com/en/support/solutions/articles/48001237271-credit-groups-explained) to assign the rule to.
* Select **Save** to save your channel configuration.
  {% endstep %}
  {% endstepper %}

### Key parameters for tracking

* `rscode`: A unique referral code parameter appended to Advocate-generated links. Optimize can use this to identify and attribute traffic to the Advocate channel.
* `utm_source`: Indicates the source of the traffic. Set to `referral` for Advocate-generated links (e.g. `utm_source=referral`).
* `utm_medium`: Indicates the marketing medium. Use this to categorise the type of referral traffic (e.g. `utm_medium=affiliate`).
* `utm_campaign`: Identifies the specific campaign associated with the referral link (e.g. `utm_campaign=november-promo`).

{% hint style="info" %}
**Tip:** Always ensure that Advocate-generated links include both `rscode` and relevant UTM parameters for maximum attribution accuracy.
{% endhint %}

### Example request

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

```json
{
  "user_id": "12345",
  "activity_type": "referral",
  "channel": "email",
  "parameters": {
    "rscode": "ADVOCATE2025",
    "utm_source": "referral",
    "utm_campaign": "november-promo"
  },
  "timestamp": "2024-08-01T00:00:00Z"
}
```

{% endtab %}
{% endtabs %}

### Example response

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

```javascript
<script>
  {
    "status": "success",
    "message": "Advocate activity recorded.",
    "activity_id": "act_67890",
    "visible_in_optimize": true,
    "caveats": [
      "Activity will be visible in Optimize reports within 15 minutes.",
      "Only activities with valid rscode or utm_source=referral are displayed."
    ]
  }
</script>
```

{% endtab %}
{% endtabs %}

### Visibility conditions & caveats

Advocate activities are only visible in Optimize if:

* The UTT or Page Load API is correctly implemented and capturing all click data.&#x20;
* The Rules to Identify (RTI) are set up to recognize Advocate-specific parameters.
* The referral traffic is not filtered out by other channel rules with higher priority (check the assigned credit groups).

Caveats:

* If the Advocate program uses non-standard parameters or custom implementations, additional configuration may be required.
* Only last-click attribution is supported for Optimize channels. If your program uses first-click or mixed attribution, results may differ.
* Postback programs (where data is provided by another program) are not supported for Optimize reporting.<br>


---

# 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/integrate-advocate-with-optimize.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.
