Quick answer
Persistent data is data that outlives the process, page or session that created it, kept on non-volatile storage until it is deleted or expires. In web analytics it covers identifiers stored in the browser (persistent cookies, localStorage) and records kept on the server under a retention rule.
What is persistent data?
Persistent data is data that outlives the process, page or session that created it. It sits on non-volatile storage (a disk, a database, the browser's saved storage) and stays available until something deletes it or it expires. The opposite is non-persistent (ephemeral) data, which lives in memory and disappears when the process ends.
In everyday computing, a saved document, a database row and a game save file are persistent; a variable in a running program is not. In web analytics the phrase usually means two things:
- Persistence in the browser: an identifier or setting the page stores on the visitor's device so it is still there on the next visit. Persistent cookies,
localStorageand IndexedDB do this. - Persistence on the server: events, visitor records and reports saved in a database, kept for as long as the retention rule says.
The reason analytics cares is identity. A tool can only say "this is a returning visitor" if something persists between visits, either an id stored in the browser or a rule on the server that recognises the same visitor again. Persistence is therefore both the thing that makes returning-visitor and retention reports possible and the thing that raises privacy questions.
"Persistent" does not mean "permanent". Every browser store has limits, users clear them, and servers delete data on a schedule.
Where persistent data lives: lifetimes compared
The same visitor id can be stored in several places, and each place has its own lifetime.
| Storage | How long it lasts | Scope | Notes |
|---|---|---|---|
| Session cookie | Until the browser session ends; a browser with session restore may bring it back | Sent to the server with every request | A cookie with no Expires or Max-Age is a session cookie |
| Persistent cookie | Until the date in Expires, or for Max-Age seconds | Sent to the server with every request | Mozilla documents that Max-Age takes precedence when both are set |
sessionStorage | Until the browser tab is closed | One tab and one origin | Not shared between tabs |
localStorage | Stays after the browser is closed and reopened | One origin; all pages on it share it | No built-in expiry; the page or the user must clear it |
| IndexedDB | Persistent until cleared | One origin | Larger structured storage |
| Server-side record | Until deleted or the retention period ends | Whole project | Not in the browser at all; the visitor cannot clear it |
| No storage (hash of address, browser and a salt) | As long as the salt lasts | Server only | Nothing is written to the device |
The difference between a cookie and web storage that matters most for analytics: a cookie travels to the server automatically, while localStorage stays on the device until the page's own script reads it and sends it.
Browsers cap how long script-written data survives
A page can ask for a cookie to last a year, but the browser decides. WebKit's tracking prevention documentation (used by Safari) says its Intelligent Tracking Prevention deletes all cookies created in JavaScript and all other script-writeable storage after 7 days without user interaction with the website. The affected storage includes IndexedDB, localStorage, sessionStorage and service-worker registrations and caches. When a landing page URL carries link decoration (extra query parameters of the kind used in tracked links), the expiry of cookies created in JavaScript on that page is capped at 24 hours.
For analytics, the practical effect is that an identifier written by a script on the page may last 7 days or less in Safari, whatever the code says. Browser rules change; check the browser vendors' current documentation, including how cookies set by a server are treated, before you rely on any lifetime.
Worked example: how much a 7-day cap loses
Sample data with stated assumptions: 10,000 visitors come back once within 30 days of their first visit, on a day uniformly spread across days 1 to 30. 25% of them (2,500) use a WebKit browser; assume the identifier is script-written and capped at 7 days. The other 7,500 keep it for the full 30 days.
| Group | Visitors returning | Recognised as the same visitor |
|---|---|---|
| Other browsers | 7,500 | 7,500 (100%) |
| WebKit, 7-day cap | 2,500 | 2,500 × 7 ÷ 30 = 583 (23.3%) |
| WebKit, 24-hour cap (link-decorated landing) | 2,500 | 2,500 × 1 ÷ 30 = 83 (3.3%) |
| Total, 7-day cap | 10,000 | 8,083, so 80.8% are recognised |
So 1,917 returning people are counted as new visitors, and the "new visitor" count and the retention curve both mislead. The size of the error depends on your browser mix and your return pattern; replace 25% and the uniform timing with your own numbers. The point of the example is that a persistence limit shows up as a change in your metrics, not as an error message.
Persistence and privacy rules
A persistent identifier is also a legal object.
- Storing or reading on the device. Article 5(3) of the EU's ePrivacy Directive (2002/58/EC, consolidated text) says storing information, or gaining access to information already stored, in a user's terminal equipment is only allowed on condition that the user has given consent, with an exception for what is strictly necessary to provide a service the user explicitly requested. This applies to cookies and to
localStoragealike. - Identifiers are personal data. The GDPR's Article 4(1) defines personal data as any information relating to an identified or identifiable natural person, and lists an online identifier among the identifiers that can make someone identifiable. A random id stored for months can therefore count as personal data if it can be linked back to a person.
- Server-side data has a clock too. Rules on storage limitation mean raw records need a retention period, after which they are deleted or reduced to aggregates.
This is a summary of the texts linked in Sources, not legal advice. For how a design without stored identifiers fits these rules, see privacy-first analytics.
What is persistent and what is not: a checklist
Use this to audit your own site:
- List every cookie and every
localStorageor IndexedDB key your pages write (the browser's developer tools show them under Application). - For each one, write who sets it (your server or a script), how long it lasts and what it holds.
- Mark any that holds an identifier or personal data. These need the consent logic of your region.
- Check that nothing sensitive (passwords, tokens that grant access) is in
localStorage, which any script on the page can read. - For server-side data, write down the retention period per data type: raw events, aggregates, exports, backups.
Related definitions: first-party cookie, third-party cookie and cookieless analytics.
Common mistakes
- Equating persistent with permanent. Browsers cap and users clear; plan for loss.
- Believing a long
Max-Ageis honored everywhere. A 7-day cap on script-written storage in some browsers makes your 1-year cookie a 7-day cookie. - Storing secrets in
localStorage. It is readable by any script on the origin, so an injected script can read it. - Treating a random id as not personal. If it lets you recognise a person across visits, the law may treat it as an identifier.
- Counting "new visitors" without checking persistence. A rise in new visitors can be an expired id, not growth.
- Forgetting the server side. Deleting the cookie does not delete the data already stored under it.
Persistent data in TapCub
TapCub's default is not to store anything in the browser, which makes the checklist short.
- Default: nothing persisted on the device. In anonymous analytics the website script writes neither a cookie nor local storage. Visitors are separated with a hash of the address and browser data and a salt; the project is created in this mode.
- How long a visitor is recognised depends on the salt. The default Balanced preset keeps a site-level salt so new and returning visitors can be compared. Strict rotates the salt each day and does not report returning visitors across days. Both truncate the address before storage. The preset is in Configuration › Settings › Privacy.
- A device id only with consent and identification. Identified mode writes a device id once consent is granted and the collection tier is 3, then creates a person at
tapcub.login. Without it, visitors who never log in stay in aggregates. The tiers and the consent rules are in Configuration › Privacy center; in the European Economic Area and the UK the default rule needs consent, and without it collection falls to the lowest tier while pageviews and custom events are still stored. - Chat remembers only if asked. The chat token lives in session storage by default and dies when the tab closes. If Let visitors "remember my conversation for 30 days" is on, the visitor can choose to keep it in local storage for 30 days.
- Server-side persistence is governed by retention. In All-platform analytics › Data › Data export you can request an asynchronous raw export; detail beyond the retention period has been deleted, while the daily summaries contain no personal data and are not deleted by the retention period.
Sources
- MDN Web Docs, Set-Cookie header (session vs permanent cookies;
Expires;Max-Ageprecedence), checked 22 November 2026 - MDN Web Docs, Web Storage API (
localStoragepersists after the browser is closed;sessionStorageends with the tab), checked 22 November 2026 - WebKit, Tracking Prevention (script-written cookies and storage deleted after 7 days without interaction; 24-hour cap with link decoration), checked 22 November 2026
- European Union, Directive 2002/58/EC, consolidated text (Article 5(3)), and Regulation (EU) 2016/679 (Article 4(1), personal data and online identifier), checked 22 November 2026
Was this explanation clear?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

Data Analyst
Explores traffic sources, conversion funnels, and retention, using clear metric definitions and concrete examples to explain what the numbers mean.