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

# Web analytics and privacy

> What the Lurk web script sends, what Lurk keeps and for how long, how a visitor opts out, and what you must tell your visitors.

> [!NOTE]
>
> This page is not legal advice and does not replace your own privacy notice.

You choose what your site measures. You are responsible for telling your visitors what is collected and why. This page says what the script, the relay and Lurk do with a visit.

## What the script sends

Every request from the script carries:

* the site id;
* two flags: whether the browser reports automation (`webdriver`) and whether its user agent says `HeadlessChrome`;
* one or more hits. A hit has an id made on the page, the time on the visitor's clock, the hit name, the page path without query or fragment, and the properties your code passes.

Lurk keeps only the properties the site declared. It refuses a hit that has any other property.

The first page view of a page load also sends:

* the referrer's origin, when it is another site (not the path or query of the referrer);
* `utm_source`, `utm_medium` and `utm_campaign` from the address of the page;
* any ad click ID from the address, which Lurk uses to tell that a visit is paid.

Your relay adds the visitor's IP address, the browser's user agent, the country your host reports, the page's origin and your project key.

## What Lurk keeps

With each hit Lurk stores:

* the hit's id, the hit name, the path, the properties, the hit's time and the date the hash belongs to;
* the visitor's daily hash;
* the id of the visit the hit belongs to, and when that visit started;
* how the visit arrived: its channel, source, medium, campaign, whether it was paid (from a click ID), its landing page, its referrer origin and its country;
* whether the hit came from a browser or from a server, and whether the visitor gave consent;
* the browser, the operating system and the kind of device (desktop, mobile, tablet or other). These are families with no version and no model.

A record of each visit is kept too: its daily hash, its times, its entry and exit paths and its campaign tags. It stays until 90 days after the visit's last hit.

## What Lurk does with the IP address and user agent

Lurk uses the IP address and the user agent for these things:

* to make the daily hash;
* to find the browser, the operating system and the device;
* to reject bots, hosting networks and the internal traffic you excluded on the site;
* to make a second digest that counts the hits of one visitor in a day against the daily limit per visitor. It is kept for 36 hours.

Lurk does not store the IP address or the user agent themselves.

## How long a hash can be made again

The hash is made from the project, the site, the UTC day, the IP address and the user agent, with a salt that is new each day.

* A day's salt expires 36 hours after that day starts. A clean-up job deletes it from live storage at that time or later, and waits while visit records still depend on it.
* Backups and recovery copies of the database can still hold the salts. The dumps in the backup bucket are kept for 35 days (daily) or 400 days (monthly). Until a copy expires, the same hash can be made from it. How long the point-in-time recovery copies of the database are kept is not documented yet.
* A hash can count as personal data while its salt exists, in backups too.

Lurk does not keep a click ID. It keeps a keyed digest of it with the visit for a short time, so that it can tell two visits apart. The digest expires when the visit has been idle for the inactivity time, at midnight UTC or when the salt expires, whichever comes first.

## How long Lurk keeps what it counts

* In live storage, raw hits are kept for 90 days and daily numbers for 25 months.
* Backups made in that time keep them longer, for the periods above.

Paths, campaign tags and properties are text you or your visitors choose. Do not put personal data into them: no names, email addresses or account numbers.

## What stays on the visitor's device

Without consent, the only thing stored on the device is the visitor's own opt-out, in `localStorage` under the key `lurk_optout`. After `lurk.consent(true)`, with identified analytics on and your relay in mode `full`, your relay also sets one cookie, `lurk_vid`, that holds a random visitor id for at most 13 months. No session id is stored. Name `lurk_optout` in your privacy notice, apart from analytics storage, and name `lurk_vid` and its 13 months in your cookie notice.

## Opt out, GPC and Do Not Track

* When a browser sends Global Privacy Control or Do Not Track, the script sends nothing and only deletes the cookie `lurk_vid` if there is one, and the relay sends nothing to Lurk.
* `lurk.optout()` stops the script counting that visitor from then on. It holds on later page loads only in the same browser, on the same site origin, and only when `localStorage` works. When it does not, the opt-out holds for the current page load.
* Hits sent before the opt-out stay stored and counted. A request already on the wire cannot be recalled.
* The opt-out lives in the browser. If that visitor is linked to a person, a conversion your server reports for that person later can still be credited to a source from a visit they made with consent before opting out, for up to 94 days.

## What reports show

Reports use daily counts. [Breakdowns](https://docs.getlurk.com/web/definitions.md#hidden-rows) hide rows with fewer than 10 daily visitors. Day totals can show below 10.

## Identified visitors

Identified analytics is off by default. With it on and your relay in mode `full`, the relay sends the persistent visitor ID with consented hits. Your server can link that ID to a person with a project key. Visits from before consent are never attached to a person. When consent is granted, the script drops anonymous hits still waiting to be sent to the relay.

After linking, every project member role, member assistants and project keys can read the person's web acquisition. Lurky and chat cannot read that field. Linking records available acquisition details in an identify event that members, member assistants, project keys and brand agents can read in the person's history.

Unlinked visitor IDs become eligible for deletion 13 calendar months after they were last seen, measured in UTC. Erasing a person removes their linked visitor records from live storage. Backups can retain those records until the copies expire.

## Your part

* Tell your visitors what you measure, and name the `lurk_optout` key.
* Keep the project key on your server.
* Name a relay header your host sets itself. See [Relay recipes](https://docs.getlurk.com/web/relay-recipes.md).
* Do not put personal data into paths, campaign tags or properties.


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