# SubID tracking

A SubID (also called subid, sub, sid, aff\_sub, sub1–sub5, etc.) is a custom value you append to an affiliate link so your network reports which click converted.

In Content Egg, anywhere you set a Deeplink, you can insert [dynamic placeholders](#url-dynamic-placeholders) (post, product, site data) to auto-build SubIDs—great for slicing performance by post, author, product, placement, and more.

**Common SubID parameters by network**

| Network                              | SubID parameter(s)   |
| ------------------------------------ | -------------------- |
| Impact                               | subId1 … subId5      |
| Rakuten Advertising (LinkShare)      | u1                   |
| Awin                                 | clickref, clickref2  |
| CJ (Commission Junction)             | sid                  |
| eBay Partner Network                 | customid             |
| Tradedoubler                         | epi, epi2            |
| TUNE / HasOffers (many CPA networks) | aff\_sub … aff\_sub5 |
| ShareASale                           | afftrack             |

{% hint style="success" %}
You can find the complete list of Sub ID parameters for popular affiliate networks and programs [here](https://ce-docs.keywordrush.com/features/subid-tracking#whats-supported).
{% endhint %}

> Some programs support multiple SubID slots. Check your network docs for exact limits and allowed characters.

**Example (Awin)**

Deeplink with SubID using post ID + product ID, and ued pointing to the destination URL:

```
https://www.awin1.com/cread.php?awinmid=MERCHANT_ID&awinaffid=AFFILIATE_ID&clickref={{post_id}}-{{item_unique_id}}&ued={{url_encoded}}
```

***

**Safe SubID variants (recommended)**

Most text [placeholders](#url-dynamic-placeholders) also support safe variants:

* {{...\_encoded}} – URL-encoded
* {{...\_base64}} – Base64
* {{...\_slug}} – slugified
* {{...\_subid}} / {{...\_subid32}} – compact, safe SubID encoding (length-capped; alphanumeric + \_-.)

Use these to avoid characters your network rejects.

**Testing & validation**

* Always test clicks in your affiliate network to confirm SubIDs are recorded.
* Some networks trim or reject certain characters; use the safe variants above.
* Watch parameter length limits (many networks accept \~100 chars; some less).

### **Override per-block with shortcode**

You can inject/override query params via add\_query\_arg:

```
[content-egg module=Bolcom template=grid add_query_arg="subid={{post_url_relative_subid32}}.top_block.{{item_ean}}"]
```

This passes: page path (safe), a placement label top\_block, and the product EAN—perfect for granular reporting.

### **Amazon note**

Amazon does not support SubIDs. Use Tracking IDs instead (limit \~100 per account). Example:

```
[content-egg module=Amazon add_query_arg="tag=CUSTOM_TAG"]
```

Create and assign distinct Tracking IDs per site/section/campaign as needed.

***

### URL Dynamic Placeholders

Use placeholders to inject dynamic values (product, page, site) into your affiliate SubIDs and [deeplink](/modules/deeplink-settings.md) parameters. Templates accept placeholders wrapped in {{...}}. At render time, each placeholder is replaced with the actual value from the product and the current page.

You can use these anywhere Content Egg asks for a SubID/Deeplink template.

Example template:

```
subid={{post_id}}-{{item_unique_id}}&name={{item_title_slug}}&page={{post_url_encoded}}&ref={{site_domain}}&mod={{item_module_id}}
```

Might resolve to:

```
subid=6231-9300000069648999&name=polymaker-polyterra-pla-1-75mm-1kg-matte-black&page=https%3A%2F%2Fexample.com%2Fbest-pla-filaments%2F&ref=example.com&mod=Bolcom
```

#### What’s supported

**1) Basic**

* {{url}} — original URL
* {{url\_encoded}} — url via urlencode
* {{url\_base64}} — base64 of url
* {{post\_id}}
* {{item\_unique\_id}}
* {{author\_id}}, {{author\_login}}

**2) Product placeholders**

* {{item\_title}}
* {{item\_brand}} *(from manufacturer if present)*
* {{item\_sku}}, {{item\_ean}}, {{item\_upc}}, {{item\_isbn}}
* {{item\_price}}, {{item\_currency}} *(ISO code, e.g., EUR)*
* {{item\_domain}} *(e.g., bol.com)*
* {{item\_module\_id}} *(module ID like Bolcom)*
* {{item\_group}}

**3) Page / Post placeholders (from current post)**

* {{post\_title}}, {{post\_slug}}, {{post\_type}}
* {{post\_url}} *(absolute permalink)*
* {{post\_url\_relative}} *(relative path of the post)*
* {{post\_author}} *(author display name)*
* {{post\_date}} *(YYYY-MM-DD)*

**4) Site / Global**

* {{site\_name}}
* {{site\_domain}} *(host part of home\_url)*
* {{site\_locale}} *(e.g., en\_US)*

**5) Time / Utility**

* {{date}} *(today in site’s local time, YYYY-MM-DD)*
* {{timestamp}} *(current Unix timestamp)*
* {{uuid}} *(random UUID v4 if available in WP)*
* {{post\_hash}} *(short stable hash of post\_id:item\_unique\_id → 8 chars)*

#### Automatic variants

For most text placeholders, we also provide:

* {{...\_encoded}} — URL-encoded value
* {{...\_base64}} — Base64-encoded value
* {{...\_slug}} — slugified value (only for non-URL strings)

Examples

* {{item\_title}} → {{item\_title\_encoded}}, {{item\_title\_base64}}, {{item\_title\_slug}}
* {{post\_title}} → {{post\_title\_encoded}}, {{post\_title\_base64}}, {{post\_title\_slug}}
* {{post\_url}} → {{post\_url\_encoded}}, {{post\_url\_base64}} *(no slug for URLs)*

#### SubID-safe variants (recommended for network limits)

Many affiliate networks restrict SubID character sets and length. Use these safe variants where you pass SubIDs:

* {{...\_subid}} — ASCII-safe, common-denominator encoding, up to 100 chars
* {{...\_subid64}} — same, capped at 64 chars
* {{...\_subid32}} — same, capped at 32 chars

If a value must be truncated, a short hash is appended to keep it stable.

**Examples**

Awin

```
https://www.awin1.com/cread.php?awinmid=MERCHANT_ID&awinaffid=AFFILIATE_ID&clickref={{post_id}}-{{item_unique_id}}&ued={{url_encoded}}
```

CJ (Commission Junction)

```
https://www.anrdoezrs.net/click-AFFID-MERCHANTID?sid={{post_id}}-{{item_unique_id}}&url={{url_encoded}}
```

Impact

```
https://tracking.impact.com/aff_c?offer_id=OFFER_ID&aff_id=PARTNER_ID&subId={{post_id}}-{{item_unique_id}}&redirect={{url_encoded}}
```

ShareASale

```
https://shareasale.com/r.cfm?b=BANNER_ID&u=AFFILIATE_ID&m=MERCHANT_ID&urllink={{url_encoded}}&afftrack={{post_id}}-{{item_unique_id}}
```

Rakuten Advertising

```
https://click.linksynergy.com/deeplink?id=AFFILIATE_ID&mid=MERCHANT_ID&murl={{url_encoded}}&u1={{post_id}}-{{item_unique_id}}
```

TradeDoubler

```
https://clk.tradedoubler.com/click?p=PROGRAM_ID&a=AFFILIATE_ID&epi={{post_id}}-{{item_unique_id}}&url={{url_encoded}}
```

Partnerize (Performance Horizon)

```
https://prf.hn/click/camref:CAMREF/destination:{{post_url_encoded}}?clickref={{post_id}}-{{item_unique_id}}
```

FlexOffers

```
https://track.flexlinks.com/a.ashx?foid=FOID&foc=FOC&fos=FOS&subId={{post_id}}-{{item_unique_id}}&url={{url_encoded}}
```

Admitad

```
https://ad.admitad.com/g/PROGRAM_ID/AFFILIATE_ID/?subid={{post_id}}-{{item_unique_id}}&ulp={{url_encoded}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ce-docs.keywordrush.com/features/subid-tracking.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
