> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CJ Affiliate and ClickFlare Integration Guide

> Track CJ Affiliate offers in ClickFlare: pass the click ID in SID, then bring commissions in from CJ reports with Conversion Upload or the API.

![CJ Affiliate and ClickFlare Integration](https://mintcdn.com/clickflare/gS923ib4WFySqxSL/images/integrations/covers/cj-affiliate.png?fit=max\&auto=format\&n=gS923ib4WFySqxSL\&q=85\&s=634f9353a16ab8cb819d7c779a8d5286)

CJ Affiliate (formerly Commission Junction) is one of the largest affiliate networks. Advertisers run their own programs on CJ, and as a publisher you apply to each advertiser separately and get your links from the CJ Account Manager.

CJ works differently from most networks in this section: **it has no S2S postback for publishers**. There is nowhere in CJ to paste a ClickFlare postback URL, so CJ can't call ClickFlare when a sale happens. You still pass the ClickFlare click ID to CJ, but the conversions come back a different way:

* **The offer URL** sends the ClickFlare click ID to CJ in the `SID` parameter. CJ stores it with every commission.
* **You bring the commissions into ClickFlare** from CJ's commission data, with [Conversion Upload](/docs/en/settings/conversion-upload.md) or through the [ClickFlare API](/docs/en/api/clickflare-api-overview.md), using the SID value as the click ID.

> [!WARNING]
>
> CJ conversions reach ClickFlare **in batches, not in real time**. They arrive when you upload them. Plan your optimization around that: a campaign can look unprofitable in ClickFlare until the latest commissions are in.

***

## At a glance

To set up CJ Affiliate with ClickFlare:

1. Set the domain and reporting time.
2. Create the CJ affiliate network.
3. Create the offer with sid.
4. Bring commissions into ClickFlare.

Each step is explained in [Setup](#setup).

| | CJ Affiliate + ClickFlare |
| - | - |
| **How it connects** | SID on the CJ link, commissions uploaded or sent by API |
| **What reaches ClickFlare** | Commission, commission ID and event date per click |
| **Timing** | In batches, each time you upload |
| **Key parameters** | `sid`, `click_id`, `payout`, `transaction_id`, `timestamp` |
| **Works with** | Every CJ advertiser you're approved for |
| **Good to know** | No publisher postback in CJ. Conversions arrive when you upload. |

***

## How the data flows

```text theme={null}
Ad click
  → https://trk.yourdomain.com/cf/r/CAMPAIGN?...
     (ClickFlare records the click and generates the click ID)
  → [optional lander → CTA uses the ClickFlare click URL]
  → CJ link with sid=CF_CLICK_ID
     (CJ stores the ClickFlare click ID as the SID)
  → Visitor buys on the advertiser's site
  → CJ records the commission with the SID
  → You export or pull commissions from CJ
  → You upload them to ClickFlare:
     CF_CLICK_ID,12.50,CJ_COMMISSION_ID,,2026-11-02T14:30:00+00:00
     (ClickFlare matches each conversion to the original click)
```

The return path is an upload, not a postback:

| Link | Built from | CJ side | ClickFlare side |
| - | - | - | - |
| **Offer URL** (in ClickFlare) | CJ's parameter + ClickFlare's token | `sid` (SID) | `{cf_click_id}` |
| **Conversion upload** (in ClickFlare) | CJ commission data mapped to ClickFlare fields | SID, commission amount, commission or order ID, event date | `click_id`, `payout`, `transaction_id`, `timestamp` |

> [!NOTE]
>
> The [Click ID & postback macros](/docs/en/integrations/click-id-and-postback-macros.md) page doesn't list CJ, because CJ has no postback macros to copy. This page has everything you need.

***

## What you'll need

* An active ClickFlare account with your **own tracking domain** set up. Shared domains get flagged by networks and blocked by browsers. See [Tracking domains](/docs/en/settings/tracking-domains.md).
* A CJ publisher account, approved in the advertiser programs you want to promote.
* Access to your CJ commission data: the commission reports in the CJ Account Manager, or CJ's Commission Detail API.
* For the API route only: a **personal access token** from the CJ Developer Portal and your CJ publisher ID (CID), plus a ClickFlare API key.

***

## What the CJ Affiliate template contains

ClickFlare has a **CJ Affiliate** affiliate network template. Only its click ID field is useful.

![The CJ Affiliate template in ClickFlare: Click Id is sid and Payout is %xc](https://mintcdn.com/clickflare/b2lpDlx8sR69TsUK/images/integrations/cj-affiliate/clickflare-cj-affiliate-template-parameters.png?fit=max\&auto=format\&n=b2lpDlx8sR69TsUK\&q=85\&s=5fe2d208d5c522c4241429f3e9886242)

| Field | Template value | What it does |
| - | - | - |
| **Click Id** | `sid` | Gives **Append Click ID to Offer Url** the parameter name, so the toggle adds `sid={cf_click_id}` to the offer URL. |
| **Payout** | `%xc` | Not used. CJ never calls the postback, so this value is never filled in. |
| **Transaction ID** | empty | Not used. |
| **Event Type** | empty | Not used. |

The **Conversion tracking** section still generates a postback URL, because every affiliate network in ClickFlare has one. With CJ it has nowhere to go. Ignore it.

![The Conversion tracking section of the CJ Affiliate network in ClickFlare, with the generated postback URL: click\_id=sid\&payout=%xc](https://mintcdn.com/clickflare/b2lpDlx8sR69TsUK/images/integrations/cj-affiliate/clickflare-cj-affiliate-postback-url.png?fit=max\&auto=format\&n=b2lpDlx8sR69TsUK\&q=85\&s=d7ac59257afd7fabb9471828610d77ca)

***

## Setup

Everything in ClickFlare is done from inside the campaign editor. Create the offer and the affiliate network inline as you go.

**1. Set up your own tracking domain**

Add a custom tracking domain before anything else, for example `trk.yourdomain.com`. Your campaign links use it, and a custom domain is less likely to be flagged than a shared one. See [Tracking domains](/docs/en/settings/tracking-domains.md).

**2. Report conversions by postback time**

Go to **Settings → General Settings** and set **Conversion registration time reporting** to **Postback Timestamp**.

With the default **Visit Timestamp**, ClickFlare reports a conversion on the day of the original click. With **Postback Timestamp**, it uses the conversion time, which for uploads is the timestamp you include (or the upload time if you leave it out). See [Conversion registration time](/docs/en/settings/conversion-registration-time-reporting.md).

> [!NOTE]
>
> This is an account-wide setting. It changes the date conversions are reported on for every campaign.

**3. Create the campaign**

Go to **Campaigns → New Campaign**, choose **Redirect tracking**, pick your traffic source and select your tracking domain. See [Creating a campaign](/docs/en/campaigns/creating-a-campaign-in-click-flare.md).

**4. Create the CJ affiliate network**

While creating the offer for the campaign, create a new affiliate network in its **Affiliate Network** field. You can also create it first under **Affiliate Networks → + New**. Either way:

1. Search for **CJ** and pick the **CJ Affiliate** template.
2. Name it, for example "CJ Affiliate". One network covers all your CJ advertisers.
3. Set **Payout currency** to the currency CJ pays you in.
4. Save the network. You don't need to copy the postback URL.

**5. Get the link from CJ**

In the CJ Account Manager, get the link for the advertiser you want to promote, for example with the deep link generator. Copy the link.

**6. Create the offer in ClickFlare**

In the offer form:

1. Name the offer, for example after the advertiser.
2. Select the CJ affiliate network you just created.
3. Paste the CJ link into **Offer URL** and turn on **Append Click ID to Offer Url**. ClickFlare adds `sid={cf_click_id}`. You can also add it by hand: `?sid={cf_click_id}` at the end, or `&sid={cf_click_id}` if the link already has a `?`. Use one or the other, not both.

   ![The Offer URL field of the ClickFlare New Offer form with a CJ Affiliate link ending in sid=\{cf\_click\_id}](https://mintcdn.com/clickflare/b2lpDlx8sR69TsUK/images/integrations/cj-affiliate/clickflare-cj-affiliate-offer-url.png?fit=max\&auto=format\&n=b2lpDlx8sR69TsUK\&q=85\&s=b05a9a994ca9f59b92a1fa1b49636f7d)

> [!WARNING]
>
> Write `{cf_click_id}` with braces. Without them CJ stores the literal text `cf_click_id` as the SID, and none of your commissions can be matched to a click.

CJ's documentation writes the parameter as `SID`, while other trackers use lowercase `sid`. After your first commissions, check that CJ shows the click ID in the SID column. If it's empty, write the parameter yourself as `SID={cf_click_id}` and leave the toggle off.

SID is optional for publishers, so CJ records commissions without it too. Those can't be matched in ClickFlare.

**7. Add a lander (optional)**

If you send traffic through a lander before the offer, the lander's CTA must use the **ClickFlare click URL**, not the CJ link. ClickFlare then fills in the click ID when it redirects to the offer. See [Paths with landers and offers](/docs/en/campaigns/campaign-s-path-destination-to-landers-offers.md).

**8. Save the campaign and launch**

Save the campaign, copy the campaign URL from the **Tracking** tab and use it in your ads. Then set up one of the two routes below to bring the commissions in.

***

## Bring CJ commissions into ClickFlare

Each CJ commission carries the SID, which is the ClickFlare click ID. Map CJ's fields to ClickFlare's like this:

| ClickFlare field | Take it from CJ | Notes |
| - | - | - |
| `click_id` | The SID value | Required. Rows without a SID can't be matched. |
| `payout` | Your commission amount | Not the sale amount. |
| `transaction_id` | CJ's commission ID or order ID | Must be unique per commission. See below. |
| `conversion_type` | Leave empty | Or a [custom conversion](/docs/en/settings/custom-conversions.md) parameter, such as `sale` or `lead`. |
| `timestamp` | The event date of the commission | ISO-8601, for example `2026-11-02T14:30:00+00:00`. |

The exact column names depend on the CJ report or API query you use. Check them in your first export.

### Route 1: Conversion Upload (no code)

1. In CJ, open your commission report for the period since your last upload and export it.
2. In a spreadsheet, keep the five columns above, in that order, and drop rows with an empty SID.
3. In ClickFlare, go to **Settings → Conversion Upload** and paste one conversion per line, in the order `click_id,payout,transaction_id,conversion_type,timestamp`, without a header line. For example:

```text theme={null}
b39be7d3-71b8-4df1-b4b7-921995a23c1f,12.50,3456789012,,2026-11-02T14:30:00+00:00
b39be7d3-71b8-4df2-b4b7-922995a23c2f,4.10,3456789013,,2026-11-02T16:05:00+00:00
```

4. Click **Upload**. See [Conversion Upload](/docs/en/settings/conversion-upload.md) for every format it accepts.

### Route 2: API (automated)

If you upload often, automate it with a small script or an automation tool:

1. Pull new commissions from CJ's **Commission Detail API** with your personal access token. CJ says transactions are batched in throughout the hour, and that this API can show some of them before they appear in the CJ interface.
2. Send each one to ClickFlare with the raw conversion uploader in the [ClickFlare API](/docs/en/api/clickflare-api-overview.md), or call your tracking domain's conversion endpoint directly:

```text theme={null}
https://trk.yourdomain.com/cf/cv?click_id=SID_VALUE&payout=12.50&txid=CJ_COMMISSION_ID
```

ClickFlare also accepts the same call as a JSON POST, with the body keys `cf_click_id`, `payout`, `txid`, `ct` and `param1` to `param20`:

```bash theme={null}
curl -X POST 'https://trk.yourdomain.com/cf/cv' \
  -H 'Content-Type: application/json' \
  --data '{"cf_click_id":"SID_VALUE","payout":12.50,"txid":"CJ_COMMISSION_ID"}'
```

Both forms carry `txid`. Use whichever your import script builds more easily.

> [!TIP]
>
> Run the import on a schedule, for example every hour or once a day. The more often it runs, the closer ClickFlare gets to real time, but it never fires on the sale itself.

***

## Why the transaction ID matters

By default ClickFlare keeps **one conversion per click ID**. If two commissions arrive with the same click ID and no transaction ID, ClickFlare treats them as the same conversion and keeps only the last one received. A transaction ID that differs per commission keeps them apart.

It also makes re-uploads safe. If you upload a commission again with the **same click ID and the same transaction ID**, ClickFlare replaces the earlier conversion instead of counting it twice. So when in doubt, upload an overlapping date range: duplicates overwrite, they don't add up.

If CJ reports a correction to a commission, such as a reversal, check how it appears in your export. A row with its own ID and a negative amount can be uploaded as its own conversion, and ClickFlare subtracts it from revenue.

***

## Verify the setup

**1. Click through the campaign**

Open the ClickFlare campaign URL (with a lander, also click the CTA). When the offer loads, the first request goes to CJ. In the address bar or your browser's network tab, check that it has `sid=` followed by a real ClickFlare click ID, not the literal text `{cf_click_id}`.

**2. Test an upload**

Copy a real click ID from ClickFlare and upload it with a test payout in **Settings → Conversion Upload**, for example `REAL_CLICK_ID,1,test1`. The conversion should show on the campaign. This tests ClickFlare's side only.

**3. Check the first real commissions**

When CJ records your first commissions, check that the SID column holds ClickFlare click IDs. Upload them and confirm they appear on the right campaign in ClickFlare.

***

## Troubleshooting

> [accordion] The SID is empty in CJ
>
> * The offer URL is missing `sid={cf_click_id}`. Check **Offer URL** or turn on **Append Click ID to Offer Url**.
> * The lander CTA links straight to CJ instead of using the ClickFlare click URL.
> * If both look right, CJ may expect uppercase `SID`. Write `SID={cf_click_id}` yourself and turn the toggle off.

> [accordion] The SID shows cf\_click\_id or braces
>
> The offer URL has the token without braces, or the braces were encoded. It must be `{cf_click_id}` exactly.

> [accordion] Uploaded conversions don't appear
>
> * The `click_id` doesn't exist in ClickFlare, for example because it came from a test click or has extra spaces. Trim the values.
> * The columns are in the wrong order. ClickFlare reads `click_id, payout, transaction_id, conversion_type, timestamp`, comma-separated.
> * The timestamp isn't ISO-8601. Leave it out to use the upload time, or fix the format.

> [accordion] Only one of several commissions shows
>
> The upload has no `transaction_id`, or the same one for every row. Add CJ's commission or order ID so each commission is unique.

> [accordion] Revenue in ClickFlare is too high
>
> You uploaded the sale amount instead of your commission. Re-upload with the commission amount and the same transaction IDs: the new values replace the old ones.

***

## FAQ

> [accordion] Does ClickFlare integrate with CJ Affiliate?
>
> Yes. ClickFlare has a CJ Affiliate template that passes the click ID in sid. CJ has no publisher postback, so you bring commissions in with Conversion Upload or the ClickFlare API.

> [accordion] Can I use the postback URL from the CJ template?
>
> No. CJ doesn't support S2S postbacks for publishers, so there's no field in CJ to paste it into. Other trackers also bring CJ conversions in by API, not by postback.

> [accordion] How often should I upload?
>
> As often as you make decisions. Daily works for most campaigns. If you scale fast or bid automatically, automate the API route and run it every hour.

> [accordion] Can I pass more data to CJ?
>
> SID is the parameter CJ describes for publishers' own tracking, and here it holds the click ID, so keep it for that. Ask CJ support whether your account can pass other values.

> [accordion] Can I send the conversion back to my traffic source?
>
> Once ClickFlare records a CJ conversion, it is a conversion like any other. Bear in mind it reaches ClickFlare in a batch, so a traffic source that optimizes on conversions gets them later than with a postback network.

***

## Related

> [card] [Conversion Upload](/docs/en/settings/conversion-upload.md)
>
> Upload formats

> [card] [ClickFlare API](/docs/en/api/clickflare-api-overview.md)
>
> Automate the import

> [card] [Macro reference](/docs/en/integrations/click-id-and-postback-macros.md)
>
> Every network's values


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.