# TradeTracker Integration

> The TradeTracker and AnyTrack integration provides real-time tracking of affiliate marketing conversions, allowing users to monitor ROI across various networks and campaigns. This integration sends conversion data from TradeTracker to AnyTrack, which then forwards it to platforms like Google Ads and Facebook `Conversion API`, enhancing visibility and optimization. The setup involves adding TradeTracker to AnyTrack, connecting accounts via a Postback URL, and mapping conversion events to ad platforms for automatic data flow and performance analysis.

## TradeTracker integration overview

The TradeTracker and AnyTrack integration unlocks powerful insights into your affiliate marketing campaigns. With the integration, data from your conversions on TradeTracker is sent to AnyTrack in real-time, enabling you to track ROI for each network and campaign. From there, AnyTrack forwards that conversion data directly to platforms like Google Ads, Facebook `Conversion API` and TikTok API - giving you total visibility of how well those campaigns are performing across all channels.

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

### How does the TradeTracker and AnyTrack integration work:

1. **Traffic**: When visitors land on your website, AnyTrack sets and collect traffic source data and First Party data.
2. **Engagements**: When visitors click on your TradeTracker affiliate links, AnyTrack does a few things:
   1. Collects granular data tied to the `OutboundClick`.
   2. Triggers Event Tracking API requests to your Tracking Tags and analytics.
3. **Conversions:** When visitors convert on the merchant's website, AnyTrack receives real time conversion data through Postback URL.
4. **Attribution:** AnyTrack processes the conversion data and reports it across various reporting sections of the AnyTrack Dashboard.
5. **`Conversion API`:** AnyTrack then sends your conversions to your **Ad Platforms' `Conversion API`** so you can feed your ad platform's Machine Learning, AI and automatic optimization according to 100% of your conversion data.

### Technical details

| Reference       | Value          | Information                                              |
| --------------- | :------------- | :------------------------------------------------------- |
| Tracking Group  | `TradeTracker` | The Tracking Group reference can be used to activate.    |
| Subid Parameter | `ref`          | The Subid Parameter used to pass the AnyTrack `click_id` |
| Tracking Method | `Postback URL` | -                                                        |

### Standard Conversions

| Event Name      | Details                                              | Data Source  |
| :-------------- | :--------------------------------------------------- | :----------- |
| `OutboundClick` | When a visitor clicks on TradeTracker offer links.   | AnyTrack Tag |
| `Lead`          | When a Lead conversion is sent by TradeTracker.      | Postback URL |
| `Purchase`      | When a Sale conversion a commission in TradeTracker. | Postback URL |

### The TradeTracker Postback URL

The Postback URL is fully pre-defined and ready to be implemented with your TradeTracker account.

```http TradeTracker Postback URL
https://t1.anytrack.io/ACCOUNTID/collect/tradetracker?transactionID={transactionID}&campaignID={campaignID}&affiliateSiteID={affiliateSiteID}&transactionType={transactionType}&transactionStatus={transactionStatus}&transactionAmount={transactionAmount}&commission={commission}&description={description}&timestamp={timestamp}&reference={reference}
```

## Setup Guide

### Step #1: Add TradeTracker to your AnyTrack Account

1. Go to the **[Integration Catalog](https://dashboard.anytrack.io/catalog/)**, search for TradeTracker.

2. Now click on the [TradeTracker integration](https://dashboard.anytrack.io/catalog/tradetracker) and then click on **Install**.

### Step #2: Connect your TradeTracker account

1. **Copy** the AnyTack Postback URL.
2. **Login** to your affiliate account.
3. **Navigate** to Account > My Sites.
4. Click to **view the site settings** and scroll down to **Edit** the site.
5. **Paste the Postback URL** in the "Conversion notification URL" field and **Save**.

<br />

<br />

### Step #3: Adjust the Conversion Event Mapping

The Event Mapping allows you to define which events to track and map them to Conversion Events you will forward to your Ads Integrations (e.g., Facebook `Conversion API`).

**Default Conversion Mapping:**

> 📘 **Good to know**
>
> For convenience purpose the table below only shows Meta Ads, Google Analytics 4 and TikTok Ads. Other integrations also have a default mapping that is outlined on the documentation and in the platform.

| Tradetracker | Meta Ads   | Google Analytics Google Analytics 4 | TikTok Ads        |
| :----------- | :--------- | :------------------- | :---------------- |
| `Lead`       | `Lead`     | `generate_lead`      | `Contact`         |
| `Sale`       | `Purchase` | `purchase`           | `CompletePayment` |

***

## Validate your integration

<Callout icon="🔎" theme="default">
  ### Install the AnyTrack Pixel Helper Extension

  Install the [AnyTrack Pixel Helper](https://chromewebstore.google.com/detail/anytrack-pixel-helper/ojmhkmdpagjeopleoeihbhgejcfoijjn) Chrome extension to verify the AnyTrack Tag is installed on your website. It also shows connected ad platforms and browser-side events. [View the Pixel Helper guide](/docs/anytrack-chrome-extension).
</Callout>

### Link tracking

Since Tracking starts when visitors clicks on offer links, you verify that your links are tracked and AutoTagged.

### AutoTag Methods

<Callout icon="🔥" theme="default">
  ### Reminder about AutoTag:

  **AutoTag** is a function that is enabled by default through the AnyTrack Tracking Tag, and that appends `r` & `click_id` data to affiliate links. Learn more about <a href='/docs/autotag'>AutoTag</a>.
</Callout>

* **Default**: By default, AnyTrack automatically identifies and AutoTags TradeTracker links found on your website.
* **AutoScan**: AnyTrack scans links that are embedded in redirects plugins and AutoTags them accordingly.
* **Manual**:
  * **Tracking Group Attribute**: You add the tracking group attribute to links according to their tracking requirements. For example: `data-tracking-group="tradetracker"` or `rel="tradetracker"`. More about [Tracking Group](/docs/tgid).
  * **Click ID Token:** You Manually append the `subid`: `&r=--CLICK-ID--` to the offer link.

See example by hovering on this [TradeTracker affiliate link](https://tc.tradetracker.net/?c=19942\&m=1243702\&a=284525\&r=\&u=).

Once the links are set up, you can check in your TradeTracker account reports and see whether the `r` parameters are passed to the offer links.

**Here is an example of how you would manually update links from`TradeTracker`:**

```html
<a href="https://example.foo/goto/tradetracker" data-tracking-group="tradetracker">Hover on the TradeTracker Demo   
Link to see the AnyTrack `click_id`</a>
```

<HTMLBlock html={"\n<a href=\"https://example.foo/goto/TradeTracker\" data-tracking-group=\"tradetracker\">Hover on the TradeTracker Demo Link to see the AnyTrack <code>click_id</code></a>\n"} />

> 📘 **Tracking**
>
> Tracking Group refers to the integration technology. For example, TradeTracker <Glossary>Tracking Group</Glossary> tracking group is `tradetracker` and ClickBank is `ClickBank`. <Glossary>The Tracking Group</Glossary>

### Conversion Tracking

To validate your setup, you wait for a conversion or trigger a test conversion yourself and inspect the conversion logs.

**TradeTracker conversion payload example**

```json

{
  "commissionGroups": [
    {
      "name": "Default",
      "description": "Default",
      "amount": "23.80",
      "id": "307729",
      "code": "DEFAULT",
      "commissionAmount": "20.00"
    }
  ],
  "transactionCurrency": "GBP",
  "searchEngine": null,
  "bannerId": "3057982",
  "groupId": "429873",
  "clickTime": "2023-05-20 12:23:11",
  "trackedAmount": null,
  "clickRef": null,
  "transactionDate": "2023-05-20 12:31:12",
  "affiliateId": "777537",
  "transactionId": "1349680710",
  "url": null,
  "clickRef5": "Zojr5qPF3fVkchrNWwIjDfCD9OkZvEyC5v",
  "phrase": null,
  "clickRef6": null,
  "merchantId": "21501",
  "clickRef3": null,
  "clickRef4": null,
  "transactionAmount": "23.80",
  "clickRef2": null,
  "commission": "20.00",
  "clickThroughTime": "2023-05-20 12:23:11"
}

```

***

<FaqAccordion
  title="FAQ and Troubleshooting"
  icon="fa-duotone fa-circle-question"
  items={[
    {
      question: "Can I import past conversions into AnyTrack?",
      answer: "No. AnyTrack can only ingest conversions that have been triggered following a visitor session on your website."
    },
    {
      question: "Can I track direct linking campaigns?",
      answer: "Yes, but this requires a custom setup. Please refer to this <a href='/docs/deeplink'>article</a>."
    },
    {
      question: "Can I use a different <code>subid</code> parameter than the one predefined by AnyTrack?",
      answer: "No."
    },
    {
      question: "Can I track conversions without the <code>click_id</code>?",
      answer: "No. The <code>click_id</code> passed to the TradeTracker links is required to track conversions."
    },
    {
      question: "The Conversion Event Name is not what I am expecting, how can I change it?",
      answer: "You can update the Event Mapping in the Integration page."
    }
  ]}
/>
