> For the complete documentation index, see [llms.txt](https://ctracker-docs.keywordrush.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ctracker-docs.keywordrush.com/affiliate-networks/custom-network.md).

# Building a custom network

A **custom network** lets you accept orders from an affiliate network Cashback Tracker has no built-in support for.

{% hint style="info" %}
**Worth knowing before you start.** This is one of the more technical parts of Cashback Tracker.

Built-in networks work as soon as you enter your API keys. A custom network takes a little more: you will be reading the other network's documentation and telling Cashback Tracker what each of its fields is called.

Set aside half an hour, keep their documentation open, and use **Send test postback** at the end to check the result before real orders arrive.

If your network is already in the built-in list, use that instead — it is quicker, and there is nothing to map.
{% endhint %}

### When you need one

Only when **all** of these are true:

* the network is not in the built-in list
* it can call your site when a sale happens — usually called a *postback*, *server-to-server* or *S2S* callback
* you are willing to keep the setup working when they change their API

If the network has no postback of any kind, a custom network cannot import its orders. You would be entering every order by hand, and there are better ways to spend an afternoon.

### Creating one

`Cashback Tracker` → `Networks` → **Add custom network**.

| Field              | What it is                                                                                                                                                                              |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Name**           | What you will see in the admin. Anything you like.                                                                                                                                      |
| **Slug**           | A short id used in the postback URL. Letters, numbers and dashes. It cannot be changed later, and it cannot clash with a built-in network.                                              |
| **Status**         | Whether to accept orders from this network. While it is off, orders it sends are **refused rather than held** — a postback arriving would be rejected and logged, not queued for later. |
| **Cashback**       | The rate every shop on this network gets, unless you give one a rate of its own.                                                                                                        |
| **Tracking links** | Three fields, explained below.                                                                                                                                                          |
| **Approval**       | Whether a postback may mark an order approved or declined. Leave it on unless you do not trust the network.                                                                             |

Once saved, use **Postback setup** on the row to connect it — see [Postbacks](/affiliate-networks/postbacks.md).

![Creating a custom network](https://3545740495-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M69sU0hfZj3QsteYxmI%2Fuploads%2Fgit-blob-c49a8ad45c51997531942c99ae2d84d690eb59df%2Fcustom-network-form.webp?alt=media)

### How tracking links are built

This is the part worth reading slowly, because there are two ways it can work and Cashback Tracker picks between them by looking at the link itself.

Every shop can have a tracking link of its own, set under `Shop catalog`. What happens next depends on what that link looks like:

* **A plain address** — we add your member's id and the destination to the end of it, using the two parameter names you set on the network.
* **A link containing `{{ }}` placeholders** — we fill those in instead, and the two parameter names are not used at all.

The choice is made per shop, so two shops on the same network can work differently. That is fine.

| Field                     | When it is used                                                                                                                                   |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| **SubID parameter**       | Plain links only. The parameter the network expects your member's id in — their documentation calls it subid, sid, aff\_sub, clickref or similar. |
| **Destination parameter** | Plain links only. The parameter that carries the address the member is going to.                                                                  |
| **Tracking link pattern** | Only for shops you have **not** given a link of their own.                                                                                        |

#### Saving yourself work with a pattern

Most networks build every merchant link the same way. If yours does, set a **Tracking link pattern** once instead of pasting a URL for every shop:

```
https://track.example.com/c?mid={{advertiser_id}}&sub={{sub_id}}&url={{url}}
```

| Placeholder         | Filled in with                                               |
| ------------------- | ------------------------------------------------------------ |
| `{{advertiser_id}}` | The shop's id at the network                                 |
| `{{sub_id}}`        | The member's id, so the order comes back to the right person |
| `{{url}}`           | Where the member is going, exactly as it is                  |
| `{{url_encoded}}`   | The same address, URL-encoded                                |

Any shop you give a link of its own ignores the pattern, so you can set the pattern for the many and override the few.

#### Which of the two url placeholders to use

Look at where you are putting it.

* **After a `?`, as the value of a parameter** — use `{{url_encoded}}`.
* **As the last part of the address, after a `/`** — use `{{url}}`.

```
https://track.example.com/c?sub={{sub_id}}&to={{url_encoded}}     ← a parameter
https://track.example.com/links/900/sid/{{sub_id}}/{{url}}        ← part of the path
```

This matters the moment a member is sent to a page that has its own `?` in it — a product with a size or a colour in the address, which is most of them.

Put a raw address into a parameter and everything after that product's own `?` stops belonging to it. The network reads a destination cut short, never sees your member's id, and the order comes back attributed to nobody.

{% hint style="warning" %}
**Using the wrong one is silent.** Nothing errors, the link still opens, and the shop still loads — the member just arrives untracked, and you find out weeks later when the orders never appeared.

Copy the finished link out of a shop page and read it before you trust it. If your network's own documentation shows an example link, match its shape: a raw address after a slash, an encoded one after an `=`.
{% endhint %}

### Giving one shop a different rate

On the shop itself: `Cashback Tracker` → `Shop catalog`, **Edit** under the shop's name, then **What this shop pays a member**.

The rate you set when creating the network covers every shop on it. Give a shop its own rate only when it should differ — a merchant paying you 3% cannot fund the same cashback as one paying 12%.

* **A share of the commission** — a share of what you earn. The safe choice: you can never pay out more than you were paid.
* **A share of the order total** — a share of what the member spent. Check your commission covers it.
* **A fixed amount per order** — the same cash amount every time, in the currency you choose.

Anything left on **Use the network's rate** keeps the network rate.

The **Cashback** column on the Networks screen tells you how many shops differ, and links to them.

{% hint style="info" %}
**This used to be a list on the network itself, called "Cashback by shop".** It has moved to the shop, where you can find it by name instead of typing its ID. Rates you set before the move are unchanged.

Built-in networks still set theirs on the network, in **Configure** — their shops come from an API and cannot be edited individually.
{% endhint %}

### What a custom network cannot do

Real limitations, not oversights. All of them follow from there being no API to ask.

* **No shop import.** You add its shops by hand with **Add shop** on the [Shop catalog](/shops-and-cashback-rates/shop-catalog.md) screen. A **Tracking link pattern** saves you giving each one its own link.
* **No coupon import.**
* **No order check.** Nothing polls it, so a postback that never arrives is an order you never get. The Orders column on the Networks screen shows a dash rather than a time, for exactly this reason.

### Do not run one alongside a built-in network

{% hint style="danger" %}
Never set up a custom network for a network that already has a built-in module — Admitad, AWIN, CJ and so on.

Cashback Tracker would treat them as two separate networks. The same purchase would arrive twice, be stored twice, and **credit the member twice**. The two would also use different cashback rates, so neither figure would be right.
{% endhint %}

If you want a built-in network to report faster, change **Download new orders** in `Settings` → `General` instead.

### Related

* [Postbacks](/affiliate-networks/postbacks.md)
* [How networks work](/affiliate-networks/how-networks-work.md)
* [Importing orders](/affiliate-networks/importing-orders.md)
