> For the complete documentation index, see [llms.txt](https://ce-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://ce-docs.keywordrush.com/modules/deeplink-settings.md).

# Deeplink settings

Deeplinks allow you to convert a direct product URL into a trackable affiliate link. This mechanism ensures that your affiliate program tracks clicks correctly and rewards you with commissions for sales. Most affiliate networks use one of two methods to generate affiliate links. Below, you'll find detailed explanations and setup instructions for each.

{% hint style="success" %}
**AI Helper: Generate Your Deeplink Automatically**

Any AI assistant that can open web pages (ChatGPT, Claude, Gemini and others) can build the Deeplink for you. Start a new chat and paste this, with your own affiliate link:

```
Read https://www.keywordrush.com/skills/keywordrush-deeplink-builder/SKILL.md and follow the instructions.

Create a Deeplink setting for Content Egg from this product affiliate link:
[paste your full affiliate link here]
```

1. Use an affiliate link to a **product page** generated in your network dashboard, not a homepage link.
2. The assistant detects the link format and gives you the exact value to use.
3. Copy it into your **Deeplink Settings** and test it on two different products.

If the assistant can't open the link, download [**SKILL.md**](https://www.keywordrush.com/skills/keywordrush-deeplink-builder/SKILL.md) and attach it to the chat instead.
{% endhint %}

### 1. Deeplink-Based Affiliate Links

Many affiliate networks (e.g., AWIN, ShareASale, CJ) use **Deeplink redirects**. These links first route the visitor through the affiliate network's servers for tracking purposes before redirecting them to the actual product page.

#### Example of a Deeplink:

```
https://ad.admitad.com/g/383ee6455773fd57830a7d95a12660/?ulp=https%3A%2F%2Fwww.lightinthebox.com%2Fen%2Fp%2Fkids-girls-rainbow-dress-purple_p7923807.html
```

As you can see, a Deeplink typically has **two components**:

* The **affiliate network’s tracking script**.
* The **encoded product URL** from the advertiser’s website (percent-encoded format).

![](https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3fnB7iKYwDc1Xhr3H3%2F-MTUXcSMaBuf-Qq59NGx%2F-MTUaZXnBze9L0C0ngFF%2F%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5.png?alt=media\&token=4cca2d9b-b14b-4522-8801-8a8cd83575d7)

{% hint style="info" %}
You can replace the product part of the URL with any other valid product link — the Deeplink will still function correctly as long as the structure is preserved.
{% endhint %}

#### How to Configure a Deeplink

1. **Generate a sample affiliate link** for any product page (not the homepage) using your affiliate account or tools provided by the network.
2. **Identify the product URL** inside the link.
3. **Replace** the product URL portion with the [placeholder](https://ce-docs.keywordrush.com/features/subid-tracking#url-dynamic-placeholders) `{{url_encoded}}`.
4. **Paste** the new Deeplink into the **Deeplink URL field** in Content Egg.

**Example Template:**

```
https://ad.admitad.com/g/383ee6455773fd57830a7d95a12660/?ulp={{url_encoded}}
```

When generating links, Content Egg will automatically substitute `{{url_encoded}}` with the current product’s encoded URL.

{% hint style="info" %}
Use `{{url}}` instead if the network does **not** require encoding.
{% endhint %}

### 2. Direct Affiliate Links with ID Parameters

Some affiliate programs (like Amazon) don't use Deeplink redirection. Instead, they simply append a unique affiliate ID to the product URL.

#### Example Amazon Affiliate Link:

```
https://www.amazon.com/dp/B07XKF5RM3/?tag=yourtag-20
```

* `yourtag-20` is your **affiliate tracking ID**
* `tag` is the **parameter name** used by Amazon (this may vary across networks)

![](https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3fnB7iKYwDc1Xhr3H3%2F-MTUXcSMaBuf-Qq59NGx%2F-MTUcO26GuqiyTqiof_y%2F%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5.png?alt=media\&token=35efd43f-b4ee-429b-9354-f93d000d3b03)

#### How to Set Up Affiliate ID-Based Links

1. **Generate a few affiliate links** using your advertiser’s website or affiliate dashboard.
2. **Identify the common tracking ID** — this will appear the same across all links.
3. **Locate the tracking parameter name** (e.g., `tag=yourtag-20`, `aff_id=abc123`).
4. **Enter the full parameter** (name + value) in the domain settings within Content Egg.

{% hint style="warning" %}
**Do not include** `?`, `&`, or any prefixes before the parameter. Content Egg will automatically format the final URL properly when generating links.
{% endhint %}

#### ✅ Correct:

* `tag=yourtag-20`
* `aff_id=abc123`

#### ❌ Incorrect:

* `?tag=yourtag-20`
* `&tag=yourtag-20`
* `yourtag-20`
* Just `tag` without a value

### Optional Tracking Parameters

Some networks allow you to pass additional information (e.g., sub IDs) for better tracking. You can use the following dynamic templates within your Deeplink:

* `{{post_id}}` – WordPress Post ID
* `{{author_id}}` – Post Author's User ID
* `{{author_login}}` – Post Author’s Username
* `{{item_unique_id}}` – Unique ID of the product

Please check the full list of [supported placeholders](https://ce-docs.keywordrush.com/features/subid-tracking#url-dynamic-placeholders).

### Multiple Deeplinks

Content Egg Pro supports multiple Deeplinks for different domains or subdomains. This is useful if you work with networks that require different tracking templates for specific sites.

Syntax:

```
default_deeplink;subdomain1:deeplink1;subdomain2:deeplink2
```

Example:

```
https://alitems.com/g/1234567/?ulp={{url_encoded}};tmall.aliexpress.com:https://alitems.com/g/abcdef/?ulp={{url_encoded}}
```

In this example:

* The default Deeplink (`https://alitems.com/g/1234567/?ulp={{url_encoded}}`) will be used for all domains unless a match is found.
* A specific Deeplink (`https://alitems.com/g/abcdef/?ulp={{url_encoded}}`) will be used **only** for `tmall.aliexpress.com`.

### Advanced Regex Syntax

For more complex scenarios, you can apply **custom rewrite rules** using regular expressions in the following format:

```
[regex][pattern][replacement]
```

This allows you to **search and replace** parts of the product URL using regex.

Examples:

Flipkart:

```
[regex][~https://www.flipkart.com/(.+)/~][http://dl.flipkart.com/dl/$1&affid=myaffid]
```

Shopee Malaysia:

```
[regex][~https://shopee.com.my/(.+)/~][https://shopee.com.my/universal-link/$1?utm_source=an_12345670001&utm_medium=affiliates&utm_campaign=-&utm_content=kpgmk-aepro---&af_siteid=an_12358850002&pid=affiliates&af_click_lookback=7d&af_viewthrough_lookback=1d&is_retargeting=true&af_reengagement_window=7d&af_sub_siteid=kpgmk-aepro---&c=-]
```

#### Pattern delimiter

The pattern is a PHP regular expression, so it needs a delimiter at the start and at the end. Use `~` (as in the examples above) instead of `/`: URLs are full of slashes, and an unescaped `/` inside a `/.../` pattern breaks the rule, so the original URL is used without a deeplink.

#### Encoding a captured group

Some networks, such as Daisycon, expect only the path of the page, URL-encoded, instead of the full product URL. To encode a single captured group, wrap it in `{{urlencode:$1}}` or `{{rawurlencode:$1}}`:

```
[regex][~^https?://[^/]+/(.*)$~][https://ds1.nl/c/?wi=123&li=456&dl={{rawurlencode:$1}}]
```

For `https://www.coolshop.de/s/kampagne=black-friday/` this gives:

```
https://ds1.nl/c/?wi=123&li=456&dl=s%2Fkampagne%3Dblack-friday%2F
```

The same rule works for product pages, category pages, campaign pages and the homepage (the path is empty there).

* `{{urlencode:$1}}` writes a space as `+`, `{{rawurlencode:$1}}` writes it as `%20`. Most networks accept both; use `rawurlencode` when in doubt.
* The number is the group number: `$1`, `$2`, `${1}` and `\1` all work, and `{{urlencode:$2}}` encodes the second group.
* You can mix encoded and plain groups in one replacement, for example `host=$1&path={{rawurlencode:$2}}`.

### Final Tips

* After configuring your Deeplinks or affiliate IDs, **test a few product pages**.
* Ensure that redirection works as expected and **clicks are being tracked** properly in your affiliate dashboard.
* If tracking isn’t working, double-check the templates and encoding format.
