# Tracking links

To make successful tracking, you must follow next rules:

* User must be registered and logged in on the site;
* User must click on special link with SubID. You can make such links with special shortcodes. Also, SubID support is available in our Content Egg and Affiliate Egg plugins and in some themes, like Rehub.

Plugin has some ready shortcodes for tracking links.

{% hint style="info" %}
If user is not logged in on site and clicks such link, it will work as simple affiliate link without tracking and cashback.
{% endhint %}

### Tracking link for domain

Next shortcode will make tracking link for aliexpress merchant:

```php
[tracking-link advertiser="aliexpress.com" anchor="Click here for cashback!" /]
```

{% hint style="warning" %}
You must have approve from merchant in your affiliate network. If you was approved recently, make refresh list of joined advertisers in settings of module.
{% endhint %}

### Tracking link for Advertiser ID

More safe and recommended way is to use advertiser ID instead domain and set also module name:

```php
[tracking-link advertiser=6115 module=Admitad anchor="Go to Aliexpress" /]
```

{% hint style="success" %}
How to get Advertiser ID in [Affiliate networks settings](/admitad.md).
{% endhint %}

### Tracking link for product URL

You can also make special link on product page of merchant instead homepage:

```php
[tracking-link advertiser=6115 module=Admitad product="https://aliexpress.com/item//32218315642.html" target="blank"]Product tracking link[/tracking-link]
```

### All available parameters of shortcode

| **Parameter name** | **Synonym**    | **Required?** | **Description**                                                    |
| ------------------ | -------------- | ------------- | ------------------------------------------------------------------ |
| advertiser         | advertiser\_id | Yes           | Domain of merchant or Advertiser ID                                |
| module             | module\_id     | No            | Module name. For example: Admitad, Awin, Demo.                     |
| anchor             | text           | No            | Text of link. If you don't add it, you will get url as text of url |
| product            | product\_url   | No            | URL of product.                                                    |
| class              |                | No            | css class for link.                                                |
| target             |                | No            | target attribute                                                   |
| rel                |                | No            | rel attribute. By default - nofollow                               |

### How to make tracking link with custom attributes?

WordpPress doesn't officially allow to use shortcodes inside HTML. But it still works in HTML editor

In Gutenberg editor, add Custom HTML or switch to Code editor in classic Editor.

![](/files/-M6Gtoe4Ev3fTxFn8VXT)

Then, you can add href parameter to make custom link.

```php
<a href="[tracking-link advertiser=15767 /]">My custom link</a>
```


---

# 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://ctracker-docs.keywordrush.com/shortcodes/tracking-links-shortcode.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.
