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

# Server-Side Click Tracking

> Record clicks and generate transaction IDs using a server-side HTTP request to your Everflow tracking domain.

If you cannot host JavaScript on your pages or need to record clicks from a backend service, you can create clicks by making a server-side HTTP request directly to your Everflow tracking domain. This returns a transaction ID that you can use for conversion attribution, just like the [JavaScript SDK](/sdk/click-tracking).

<Note>This method is for click tracking only. It does not apply to [impression tracking](/sdk/impression-tracking) or smart link tracking.</Note>

## When to use server-side clicks

* Your environment does not support JavaScript (email, SMS, native apps, server-to-server flows)
* You need to record clicks from a backend service before redirecting the user
* You want full control over when and how clicks are created

## Creating a click

Make a GET request to your tracking domain's `/clk` endpoint to receive a JSON response instead of a redirect:

```
GET https://{your-tracking-domain}/clk?oid={offer_id}&affid={affiliate_id}
```

### Required parameters

| Parameter | Type    | Description      |
| --------- | ------- | ---------------- |
| `oid`     | integer | The offer ID     |
| `affid`   | integer | The affiliate ID |

### Optional parameters

You can append any of the standard Everflow tracking parameters to the click URL. Common ones include:

| Parameter        | Type    | Description                                           |
| ---------------- | ------- | ----------------------------------------------------- |
| `sub1` – `sub10` | string  | Sub-placement tracking values                         |
| `source_id`      | string  | Traffic source identifier                             |
| `uid`            | integer | Offer URL ID (extra destination URL)                  |
| `creative_id`    | integer | Creative identifier                                   |
| `coupon_code`    | string  | Coupon code for click-level attribution               |
| `fbclid`         | string  | Facebook click ID                                     |
| `gclid`          | string  | Google Ads click ID                                   |
| `idfa`           | string  | Apple Identifier for Advertisers (format: 8-4-4-4-12) |
| `google_aid`     | string  | Google Advertiser ID for mobile tracking              |
| `android_id`     | string  | Android device ID                                     |

For the full list of supported parameters and macros, see the [Parameters & Macros guide](https://helpdesk.everflow.io/customer/your-guide-to-parameters-macros).

### Response

```json theme={null}
{
  "aid": 411,
  "error_code": 0,
  "oid": 2101,
  "session_duration": 24,
  "transaction_id": "73b30b226eb44dc884d56968282b8f39"
}
```

| Field              | Type    | Description                                                               |
| ------------------ | ------- | ------------------------------------------------------------------------- |
| `transaction_id`   | string  | The unique transaction ID for this click, used for conversion attribution |
| `oid`              | integer | The offer ID that was passed in                                           |
| `aid`              | integer | The affiliate ID that was passed in                                       |
| `session_duration` | integer | The session duration in hours for this offer                              |
| `error_code`       | integer | `0` indicates success                                                     |

## Examples

### Python

```python theme={null}
import requests

response = requests.get(
    "https://www.your-tracking-domain.com/clk",
    params={
        "oid": 123,
        "affid": 266,
        "sub1": "campaign_abc"
    }
)

data = response.json()
transaction_id = data["transaction_id"]
```

### cURL

```bash theme={null}
curl "https://www.your-tracking-domain.com/clk?oid=123&affid=266"
```

### PHP

```php theme={null}
$params = http_build_query([
    'oid' => 123,
    'affid' => 266,
    'sub1' => 'campaign_abc'
]);

$response = file_get_contents("https://www.your-tracking-domain.com/clk?{$params}");
$data = json_decode($response, true);
$transactionId = $data['transaction_id'];
```

## Using the transaction ID

Once you have the `transaction_id`, pass it when firing a conversion to attribute it back to this click. You can fire conversions via the [JavaScript SDK](/sdk/conversion-tracking), the [Network API](/api-reference/post-networksconversionsreporting), or a server-side postback.
