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

# link.clicked

Occurs whenever a link is clicked (or when its QR code is scanned).

> [!TIP]
>
> You can scope which links trigger a `link.clicked` webhook. When creating or editing the webhook in the dashboard, choose one of the following:
>
> 1. **All links** – trigger the webhook for every link in your workspace.
> 2. **Include specific folders** (recommended) – trigger the webhook for all links in the selected folders.
> 3. **Include specific links** – trigger the webhook only for the links you explicitly select.
>
> If you select the 3rd option, you can programmatically associate specific links with your `link.clicked` webhook by passing the webhook ID under the `webhookIds` [prop](/docs/api-reference/links/create#body-webhook-ids-one-of-0) when creating or updating a link.

## Response body parameters

All webhook payloads follow a consistent top-level structure with
event-specific data nested within the `data` object.

**id** `string`

The event ID.
**event** `string`

The event type that triggered the webhook (e.g., `link.clicked`).
**createdAt** `string`

ISO 8601 timestamp when the webhook event was created.
**data** `object`

Event-specific data containing detailed information about the event. The
data object for the `link.clicked` event contains the following
parameters:

**object parameters**

**click** `object`

Details about the click event.

**click object**

**id** `string`

Unique identifier for the click.

**timestamp** `string`

ISO 8601 timestamp when the click occurred.

**url** `string`

The destination URL that was visited.

**country** `string`

Country code (e.g. `US`).

**city** `string`

City name.

**region** `string`

Region or region code.

**continent** `string`

Continent code (e.g. `NA`).

**device** `string`

Device type (e.g. `Desktop`, `Mobile`).

**browser** `string`

Browser name (e.g. `Chrome`).

**os** `string`

Operating system (e.g. `Mac OS`).

**ua** `string | null`

User agent string.

**trigger** `string | null`

How the click was triggered (e.g. `link`, `qr`, or `deeplink`).

**referer** `string`

Referrer hostname or `(direct)`.

**refererUrl** `string`

Full referrer URL or `(direct)`.

**qr** `boolean`

Whether the click came from a QR code scan.

**ip** `string`

IP address of the visitor.

**link** `object`

The link resource that was clicked (full link object including stats such as `clicks`, `shortLink`, `url`, etc.).

```json Response theme={null}
{
  "id": "evt_b9ywgxWqai2glUpCQjclB17kM",
  "event": "link.clicked",
  "createdAt": "2024-08-30T10:16:13.149Z",
  "data": {
    "click": {
      "id": "d0UtZqE0BZuBPrJS",
      "timestamp": "2024-08-30T10:16:12.124Z",
      "url": "https://github.com/dubinc/dub",
      "country": "US",
      "city": "San Francisco",
      "region": "CA",
      "continent": "NA",
      "device": "Desktop",
      "browser": "Chrome",
      "os": "Mac OS",
      "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36",
      "trigger": null,
      "referer": "(direct)",
      "refererUrl": "(direct)",
      "qr": false,
      "ip": "63.141.57.109"
    },
    "link": {
      "id": "cm0faqkyn0001txvfwjfeq7gl",
      "domain": "dub.sh",
      "key": "79ys3WA",
      "url": "https://github.com/dubinc/dub",
      "trackConversion": true,
      "externalId": null,
      "tenantId": null,
      "partnerId": null,
      "programId": null,
      "archived": false,
      "expiresAt": null,
      "expiredUrl": null,
      "disabledAt": null,
      "password": null,
      "proxy": false,
      "title": null,
      "description": null,
      "image": null,
      "video": null,
      "rewrite": false,
      "doIndex": false,
      "ios": null,
      "android": null,
      "geo": null,
      "publicStats": false,
      "folderId": null,
      "tagId": null,
      "tags": [],
      "webhookIds": [],
      "comments": null,
      "shortLink": "https://dub.sh/79ys3WA",
      "qrCode": "https://api.dub.co/qr?url=https://dub.sh/79ys3WA?qr=1",
      "utm_source": null,
      "utm_medium": null,
      "utm_campaign": null,
      "utm_term": null,
      "utm_content": null,
      "userId": "cm022rkcw0000ikt14mscg9sg",
      "workspaceId": "ws_cm022sis60003ikt1syy7kfhl",
      "clicks": 11,
      "lastClicked": "2024-08-30T07:45:09.000Z",
      "leads": 6,
      "conversions": 4,
      "sales": 10,
      "saleAmount": 200000,
      "createdAt": "2024-08-29T13:03:59.098Z",
      "updatedAt": "2024-08-30T10:16:12.126Z",
      "projectId": "cm022sis60003ikt1syy7kfhl",
      "testVariants": null,
      "testCompletedAt": null,
      "testStartedAt": null
    }
  }
}
```


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