# Get the analytics visitor ID

**Publié le** : 2026-05-12
**Catégorie** : Analytics & Tracking

## `GET /analytics/visitor-id`

**Get the analytics visitor ID**

Read or assign the visitor's anonymous tracking ID. Returns the ID
from the visitor cookie when present, otherwise derives one from a
fingerprint (server-side hash of IP + user-agent + accept-language)
and labels the source. Envelope has no `data` wrap; field names
are snake_case.

### Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |


> **Notes:** Envelope has no `data` wrap; the controller calls `response.json()`
> directly. Field names are snake_case. Cache: `Cache-Control: private, no-store`. Rate-limit bucket: analytics (~1200 rpm per IP).

### Examples

```curl
curl --cookie "lynkow_v_id=anon-01HZ..." "https://api.lynkow.com/public/{siteId}/analytics/visitor-id"
```

```javascript
const res = await fetch(`https://api.lynkow.com/public/${siteId}/analytics/visitor-id`, { credentials: 'include' })
const { cookie_visitor_id, source } = await res.json()
```

### Response Example

```json
"{\n  \"cookie_visitor_id\": \"anon-01HZX0K7DV2T6PMR4HB9CN1AYE\",\n  \"source\": \"cookie\"\n}\n"
```

---