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

# Tracking Links

> Create links, point them at any page, tag them with sub-IDs, and get credit for newsletter readers who order later.

A tracking link is any address on immitranslate.com with your link's slug in the `ref` parameter:

```text theme={null}
https://immitranslate.com/?ref=k7xq3m9p
```

When someone opens it, we record the visit and remember it in their browser for 90 days. Any order they place in that time is credited to you.

## Parameters

| Parameter | Required | Description |
| - | - | - |
| `ref` | Yes | Your link's slug. |
| `sub` | No | A [sub-ID](#sub-ids): your own tag for a campaign, placement or sub-affiliate. |
| `hem` | No | The SHA-256 hash of the reader's email address, for [newsletters](#newsletters-and-email-matching). |

A full link with all three:

```text theme={null}
https://immitranslate.com/certified-translation?ref=k7xq3m9p&sub=march-issue&hem=86e0b9e56c17cc4d12387e1949b85053fbe73bc3ce5a1188713a9d300cc6133d
```

## Your links

Create and manage links on the [Links page](https://portal.immitranslate.com/affiliate/links). Use separate links for separate placements, such as your website, your newsletter and your videos, to see which one brings in orders. Each link shows the referrals and orders it has brought in.

![The Links page: a website, newsletter and YouTube link, each with its own referrals and orders](https://mintcdn.com/immitranslate/GjJpSVvOo8BQwVhB/images/affiliates/affiliate-links.webp?fit=max\&auto=format\&n=GjJpSVvOo8BQwVhB\&q=85\&s=337ba06d7eee3289bc99ee5de10138d6)

Affiliate Dashboard → Links

* **New link** creates a link with a random slug, such as `k7xq3m9p`, which never reveals who it belongs to. Give it a label (up to 60 characters) so you can tell your links apart, and optionally a [landing page](#linking-to-any-page).
* You can have up to **10 active links**, and at least one must stay active.
* If a link's slug changes, the previous one keeps working and is listed under **Previous slugs**, so links you've already published never break.
* **Disable** stops a link from counting: new visits through it aren't recorded, and orders placed after you disable it aren't credited. Referrals and orders it already brought in stay on record. Enable it again at any time.
* **Delete** removes a link from your list. Its referrals and orders stay on record, and its slug is never given to anyone else.

## Linking to any page

A link leads to the homepage unless you choose a landing page for it. To send people somewhere else, either:

* set the link's landing page when you create or edit it (a page on immitranslate.com, such as `/certified-translation`), or
* use **Share a link** on the dashboard: pick a page or paste a path, and it builds the address for you, or
* add `?ref=` to any address on immitranslate.com yourself. If the address already has a `?`, use `&ref=`:

```text theme={null}
https://immitranslate.com/notarized-translation?ref=k7xq3m9p
https://immitranslate.com/pricing?utm_source=newsletter&ref=k7xq3m9p
```

Links can only lead to pages on immitranslate.com.

## Sub-IDs

Add `sub` to any of your links to tag the visits that come through it. What it means is up to you: a campaign, a placement on your site, a newsletter issue, or a sub-affiliate of yours.

```text theme={null}
https://immitranslate.com/?ref=k7xq3m9p&sub=sidebar
https://immitranslate.com/?ref=k7xq3m9p&sub=n400-walkthrough
```

A sub-ID can have letters, digits, dots, dashes and underscores, up to 64 characters. It's recorded on every referral and order that comes through the link and shown in the **Referrals** and **Transactions** pages and the CSV export. A value with other characters is ignored, but the visit still counts.

## Newsletters and email matching

A reader who opens your newsletter on their phone may order days later on their laptop, where your link was never clicked. To get credit for those orders, add `hem` to the links in your newsletter: the SHA-256 hash of the reader's email address.

If that reader later places an order with the same email address, the order is credited to you even when they come back on their own, on another device or without your link, as long as it's within 90 days of the click. These orders show **Email match** in Transactions.

We only ever receive the hash, never the address itself.

### Making the hash

Hash the email address **trimmed and in lower case**, and send the hash as 64 lowercase hexadecimal characters. Most email tools offer a SHA-256 merge tag for this; check that it lower-cases the address first.

```bash Shell theme={null}
printf '%s' "jane.doe@example.com" | tr '[:upper:]' '[:lower:]' | shasum -a 256 | cut -d' ' -f1
```

```javascript JavaScript theme={null}
const email = " Jane.Doe@Example.com ".trim().toLowerCase();
const bytes = new TextEncoder().encode(email);
const digest = await crypto.subtle.digest("SHA-256", bytes);
const hem = [...new Uint8Array(digest)].map((b) => b.toString(16).padStart(2, "0")).join("");
```

```python Python theme={null}
import hashlib

hem = hashlib.sha256(" Jane.Doe@Example.com ".strip().lower().encode()).hexdigest()
```

```php PHP theme={null}
$hem = hash('sha256', strtolower(trim(' Jane.Doe@Example.com ')));
```

For Gmail addresses, a hash of the address with or without dots and `+tags` both match, since some email tools normalize them before hashing.

## How a referral is tracked

1. **The visit.** When someone opens a page with your `ref`, we record a referral with its landing page, referring site, device and country, and store your link in a first-party cookie for 90 days. Reloading the same link in the same visit doesn't count twice. Known bots and crawlers aren't counted.
2. **The last click wins.** If the visitor later opens a different tracking link, whether yours with another sub-ID or another affiliate's, that click replaces the earlier one and its 90 days start over.
3. **The order.** When the visitor orders, the order is credited to the link in their cookie. Every order they place within the 90 days earns a commission, not only the first.
4. **Email match.** An order placed without the cookie is matched to the most recent click whose `hem` matches the customer's email address, within 90 days of that click.

![The Referrals page: each visit with its link, landing page, referrer, device and country](https://mintcdn.com/immitranslate/GjJpSVvOo8BQwVhB/images/affiliates/affiliate-referrals.webp?fit=max\&auto=format\&n=GjJpSVvOo8BQwVhB\&q=85\&s=4d50b8a20c8897fca1025426f1e27375)

Affiliate Dashboard → Referrals: every visit through your links

### What isn't credited

* Your own orders, placed from your account or with your email address.
* Orders placed through a partner integration.
* Orders placed after your link was disabled or your affiliate account was deactivated.
* Orders from a visitor whose browser blocks or clears cookies, or who orders on another device, unless the link carried `hem`.

Refunded, voided and cancelled orders reverse their commission. See [Commissions and Payouts](https://docs.immitranslate.com/affiliates/commissions-and-payouts.md).


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