# Custom Affiliate Networks

> Discover how to track conversions from custom affiliate networks not available in the AnyTrack catalog. This guide explains adding tracking links, handling click IDs, and setting up postbacks to enhance conversion tracking for custom integrations.

Track conversions from affiliate networks not in the AnyTrack [Integration Catalog](/docs/integration-catalog). This guide uses **Adtraction** as a complete example.

<Prerequisites
  title="Before you begin"
  items={[
    { label: "You have an AnyTrack account with a paid subscription", done: true },
    { label: "You have an active account with your affiliate network", done: true },
    { label: "The AnyTrack Tracking Tag is installed on your website", done: true },
    { label: "You have access to your affiliate network's documentation", done: true },
  ]}
/>

## Step 1: Research Your Affiliate Network

Collect this information from your affiliate network before setting up tracking:

<Tabs>

  <Tab title="Tracking Parameter">
    Look for the parameter name used to pass tracking data. Common examples:

    * **Impact**: `subid1`
    * **CAKE**: `s2`
    * **ClickBank**: `TID`
    * **Adtraction**: `epi` *(our example)*

    Check your network's documentation for terms like "tracking parameters," "custom parameters," or "tracking tokens."
  </Tab>

  <Tab title="Postback Variables">
    Locate the variables your network sends in postback notifications. You need:

    * **Click ID variable** (contains your tracking data)
    * **Commission variable** (payout amount)
    * **Order ID variable** (transaction identifier)
    * **Other variables** (currency, timestamp, etc.)

    **Adtraction postback variables:**

    <Image align="center" border={true} src={readmeAsset1} alt="Complete list of available postback variables from Adtraction" />

    **Key variables for AnyTrack:**

    * `${epi}` - Contains tracking data
    * `${commissiondecimal}` - Commission amount
    * `Advertiser order number` - Transaction ID
  </Tab>

  <Tab title="Postback Support">
    Verify your network can send postback notifications to external URLs when conversions occur.

    > 📘 **Postback URL Terminology**
    >
    > Different affiliate networks use various terms for the same concept. When searching your network's documentation, look for any of these terms: Postback URL / Callback URL, Server-to-Server URL, Webhook / HTTP Callback, Instant Notification URL / IPN, or Conversion Tracking URL. All of these refer to the same functionality: a URL that the affiliate network calls when a conversion occurs.
  </Tab>

</Tabs>

## Step 2: Tag Your Affiliate Links

Add the tracking parameter with the `--CLICK-ID--` placeholder to all affiliate links.

**Adtraction example:**

**Original link:**

```
https://adtraction.com/offer123
```

**Tagged link (note the ? for first parameter):**

```
https://adtraction.foo/offer123?epi=--CLICK-ID--
```

If the URL already has parameters, use `&` instead:

```
https://adtraction.foo/offer123?existing=param&epi=--CLICK-ID--
```

### Important: AnyTrack Autotag Feature

AnyTrack's [AutoTag](/docs/autotag) feature automatically substitutes the `--CLICK-ID--` placeholder with the actual click ID when visitors click your links.

<HTMLBlock html={"\n<div style=\"text-align: center; margin: 20px 0;\">\n  <a href=\"https://adtraction.foo/offer123?existing=param&epi=--CLICK-ID--\" style=\"background-color: #0066cc; color: white; padding: 12px 24px; text-decoration: none; border-radius: 6px; font-weight: bold; display: inline-block;\">\n    🚀 HOVER TO SEE THE CLICKID BEING GENERATED\n  </a>\n</div>\n"} />

<br />

### Link Plugin Redirect Considerations

**If using link redirect plugins:**

* **Forward the `subid` parameter** to the destination URL - the redirect must pass through the tracking parameter
* **Make the click ID visible on your website** - don't embed the `--CLICK-ID--` token inside the redirect plugin itself
* The click ID should be visible in the final destination URL that visitors see

**Correct redirect setup:**

```
Your page link: yoursite.com/go/offer?epi=--CLICK-ID--
Embedded offer link: adtraction.com/offer123
Final destination after redirect: adtraction.com/offer123?epi=ACTUAL_CLICK_ID
```

### Verify Link Tagging

1. Publish the tagged links on your website
2. Navigate to a page with the links
3. Hover over a link to verify the `--CLICK-ID--` placeholder is replaced with an actual click ID value
4. Click the link and confirm the click ID appears in the final destination URL

## Step 3: Create Custom Integration

<Image align="center" alt="_Browse to the Custom Integration option in AnyTrack's integration catalog_" border={true} caption="_Browse to the Custom Integration option in AnyTrack's integration catalog_" src={readmeAsset2} />

1. Go to **Integrations** in your [AnyTrack dashboard](https://dashboard.anytrack.io/catalog/)
2. Search and install **Custom Integration**
3. Fill in the integration details:
   * **Name**: Adtraction
   * **Login URL**: [https://adtraction.com](https://adtraction.com) (optional)
4. Click Next

### Configure Postback URL Template

Map Adtraction postback variables to AnyTrack placeholders:

<Image align="center" border={true} src={readmeAsset3} className="border" />

<br />

| AnyTrack Field                    | Adtraction Variable         | Description                                   |
| --------------------------------- | --------------------------- | --------------------------------------------- |
| **Sub ID/Click ID Placeholder**   | `${epi}`                    | _Required_ - Contains the click tracking data |
| **Commission/Payout Placeholder** | `${commissiondecimal}`      | _Required_ - Commission amount                |
| **Transaction ID Placeholder**    | `Advertiser order number`   | _Optional_ - Unique transaction ID            |
| **Product/Brand Name**            | Leave empty or static value | _Optional_ - Product identifier               |
| **Timestamp**                     | `${actiondate}`             | _Optional_ - Transaction timestamp            |

> 📘 **Enhanced Event Data for Better Attribution**
>
> AnyTrack supports additional [Event Attributes](/docs/event-attributes) that can improve your conversion tracking and ad platform integration. If your affiliate network provides any of these parameters in their postback, include them by appending `&country=${country}&currency=${currency}` after the postback URL provided by AnyTrack.
>
> **Geographic Data:** `country`, `state`, `city`, `zipcode`
>
> **Transaction Details:** `currency`, `transactionId`, `brand`, `shippingPrice`, `taxPrice`, `timestamp`
>
> **Product Information:** `items` — array of purchased products with `id`, `name`, `quantity`, `price`
>
> Ad platforms like Facebook Ads, Google Ads, and TikTok Ads use this data for Event Match Rate optimization. Geographic data is often available to affiliate marketers and improves attribution accuracy.

> 🚧 **Important**
>
> The Sub ID/Click ID field must use `${epi}` since that's where Adtraction sends the tracking data you passed in your links.

4. Click **Save** to generate your postback URL

<Image align="center" border={true} src={readmeAsset4} className="border" />

## Step 4: Configure Network Postback

1. Copy the generated postback URL from AnyTrack
2. Log into your Adtraction dashboard
3. Find the postback/callback settings
4. Add the AnyTrack postback URL
5. Save the configuration

## Step 5: Test Your Setup

### Method 1: Test Mode

1. Enable test mode in your funnel settings
2. Click through an Adtraction affiliate link
3. Complete a test conversion
4. Check the Events Log in your custom integration

### Method 2: Live Testing

1. Wait for an actual conversion to occur
2. Check the Events Log in your custom integration
3. Verify the conversion data appears correctly

**Note**: You'll only see conversion events after Adtraction confirms a sale and sends the postback notification.

## Understanding Conversion Types

> 📘 **Conversion Type Detection**
>
> AnyTrack automatically determines the conversion type based on the commission value. A **Lead** event is triggered when commission = 0, and a **Purchase** event is triggered when commission > 0. This automatic detection categorizes your conversions without manual configuration.

<FaqAccordion
  title="FAQ and Troubleshooting"
  icon="fa-duotone fa-circle-question"
  items={[
    {
      question: "Which affiliate networks support postback tracking?",
      answer: "Most affiliate networks support postback (server-to-server) notifications. Look for terms like Postback URL, Callback URL, Server-to-Server URL, or Webhook in your network's documentation. If your network only supports tracking pixels (client-side), it cannot be integrated using this method."
    },
    {
      question: "Can I track multiple custom affiliate networks simultaneously?",
      answer: "Yes. Create a separate Custom Integration in AnyTrack for each affiliate network. Each integration generates its own postback URL with unique field mappings tailored to that network's variables."
    },
    {
      question: "What if my network does not support postback notifications?",
      answer: "If your network does not support server-to-server postbacks, you cannot use the Custom Integration method. Check the <a href='/docs/integration-catalog'>Integration Catalog</a> for pre-built integrations that may support your network through other tracking methods."
    },
    {
      question: "How do I know which parameter name my network uses for tracking?",
      answer: "Check your affiliate network's documentation for terms like tracking parameters, custom parameters, SubID, or click tracking tokens. Common examples include <code>subid1</code> (Impact), <code>s2</code> (CAKE), and <code>TID</code> (ClickBank)."
    },
    {
      question: "Why are my conversions not appearing after setting up the postback?",
      answer: "Verify these common causes: the postback URL is correctly saved in your network's settings, your affiliate links include the tracking parameter with the <code>--CLICK-ID--</code> placeholder, and the Sub ID field mapping matches the parameter your network sends back."
    }
  ]}
/>
