TapCub is live — analytics, insights and live chat, free on one platform
Analytics

Cookie audit: how to find and classify every cookie with DevTools

A cookie audit step by step: test before consent, after reject and after accept, build an inventory, classify each item under ePrivacy Article 5(3), check lifetimes and fix what fires too early.

Emma Collins Published Dec 3, 2026 14 min read Analytics
Sample data: 11 items observed on an example course shop; lang, stats_id, ad_click, video_visitor and ab_variant need consent or a change for EEA visitors, and only ad_click disappears after rejection.Sample data

A cookie audit lists everything your site stores on or reads from a visitor's device, then decides for each item whether it needs consent. Do it by walking one fixed path three times, before any choice, after Reject and after Accept, recording cookies, local storage and third-party requests, and classifying each by purpose under ePrivacy Article 5(3).

What you will learn

  • Test three states with a clean profile: before any choice, after Reject all and after Accept all
  • Classify by purpose: only transmission and strictly necessary, user-requested functions are exempt under Article 5(3)
  • In the sample, five non-exempt items appear before any choice and four survive Reject all

What is a cookie audit?

A cookie audit is a documented check of everything a website stores on or reads from a visitor's device: what gets set, by whom, for what purpose, how long it lasts and whether it appears before the visitor has chosen. The output is an inventory, a classification for each item and a list of fixes. A scanner can produce the raw list; the audit is the judgment on top of it.

Despite the name, cookies are only part of it. The same checks apply to local storage, session storage, tracking pixels and scripts that read information from the device. A complete audit therefore answers six questions for every item:

QuestionWhat you record
What is it?Name, storage type, domain
Who sets it?Your site, or a third party's script or request
Why?One sentence per purpose
How long?Expiry, or "until deleted" for local storage
When?Before any choice, after rejection, after acceptance
Does it need consent?Exemption or consent, with the reason

If you are unsure what a cookie is made of, start with how HTTP cookies work. The rest of this guide uses Chrome DevTools and a sample online course shop. It is not legal advice.

Which rule decides whether a cookie needs consent

In the European Economic Area the starting point is Article 5(3) of the ePrivacy Directive. Storing information, or accessing information already stored, on a user's device is allowed only with consent after clear information, except in two cases: access for the sole purpose of transmitting a communication, or access strictly necessary to provide a service the user explicitly requested. National laws implement the Directive, so check the country rules that apply to you. The cookie law entry walks through the article itself.

Three points shape the audit:

  • It is not only about cookies. The European Data Protection Board's Guidelines 2/2023, adopted in version 2.0 on 7 October 2024, analyse tracking links and pixels, local processing, tracking based on IP addresses, device reporting and unique identifiers under the same article.
  • Personal data is not the trigger. In the Planet49 judgment (C-673/17), the Court of Justice held that Article 5(3) applies whether or not the stored information is personal data, and that a pre-ticked box is not valid consent.
  • The United Kingdom now differs. After the Data (Use and Access) Act, the Information Commissioner's Office describes a statistical purposes exception for analytics used solely to improve your own service, with clear information and a free, simple way to object. It does not cover advertising or tracking individuals.

Set up a clean test before you look

An audit run in your everyday browser mixes your own logins, extensions and old cookies into the result. Set up like this:

  1. Create a new browser profile with no extensions. A private window also works for a quick pass.
  2. Pick the test location. If European visitors see a different banner, test from a European network or your consent tool's preview.
  3. Open DevTools before loading the site, open the Network panel and turn on Preserve log so redirects do not wipe requests.
  4. Write a fixed path that touches every feature. For the sample shop: home page, a course page with an embedded video, switch language, add to cart, log in, open the chat window.
  5. Note the date, browser version and the path. The next audit must repeat it exactly.
What to checkWhere in DevToolsWhat to record
CookiesApplication > Storage > CookiesName, domain, expiry or Session, HttpOnly, Secure, SameSite
Local storageApplication > Storage > Local storageKeys per origin, purpose, how they are cleared
Session storageApplication > Storage > Session storageKeys per origin; gone when the tab closes
Third-party requestsNetwork panel, Preserve log onDomain, Set-Cookie header, which script made the request
Embedded framesEach frame origin under storageVideo, map and widget storage on their own domains
Reset between runsApplication > Storage, Clear site dataDate, browser version and path used

Run the same path in every state. HttpOnly cookies appear in the Cookies pane but not in document.cookie.

Load the home page and walk the path without touching the consent banner. Then collect the evidence from these places:

  1. Cookies. Open Application > Storage > Cookies and select each origin. Record name, domain, path, expiry or "Session", and the HttpOnly, Secure and SameSite columns.
  2. Local and session storage. In the same Application panel, expand Local storage and Session storage for each origin and record the keys.
  3. Requests to other domains. In the Network panel, look for requests to domains you do not own. Click one and check its Cookies tab and Set-Cookie response header.
  4. Embedded frames. Videos, maps and widgets run on their own origins. Check each origin listed under storage, not only yours.

A console one-liner lists local storage keys quickly:

console.table(Object.keys(localStorage).map(k => ({ key: k, length: localStorage.getItem(k).length })));

Do not rely on document.cookie for the inventory: it cannot show HttpOnly cookies, which are often the session cookies you most need to document.

Step 2: repeat after reject and after accept

Clear everything with Clear site data in the Application panel, reload, click Reject all and walk the same path. Clear again, reload, click Accept all and walk it a third time. Three runs turn a list into evidence: an item that appears after rejection shows that the banner does not control it.

Sample data from the course shop (✓ present, – absent):

ItemStorageBefore choiceAfter Reject allAfter Accept all
cart_idFirst-party cookie✓✓✓
csrf_tokenFirst-party cookie✓✓✓
lb_routeFirst-party cookie✓✓✓
auth_sessionFirst-party cookie✓✓✓
langFirst-party cookie✓✓✓
stats_idFirst-party cookie✓✓✓
ad_clickThird-party cookie✓–✓
video_visitorThird-party cookie✓✓✓
ab_variantLocal storage✓✓✓
chat_tokenLocal storage✓✓✓
consent_choiceFirst-party cookie–✓✓

The "before choice" run is the one that catches most problems. Here the advertising cookie respects rejection but still fires before anyone has chosen.

Step 3: build the cookie inventory

Merge the three runs into one row per item and add purpose, owner and lifetime. Ask whoever added each tag; do not guess a purpose from a name. If nobody can explain an item, that is a finding in itself.

ItemPurposeSet byLifetimeOwner
cart_idKeep the cart across pagesShopSessionEngineering
csrf_tokenStop forged form postsShopSessionEngineering
lb_routeSend requests to the same serverLoad balancerSessionOperations
auth_sessionKeep the user logged inShopSessionEngineering
langRemember language, set on first loadShop180 daysContent
stats_idCount returning visitorsAnalytics script730 days requestedMarketing
ad_clickAttribute ad clicksAd pixel90 daysMarketing
video_visitorNot documented by the teamVideo embed180 daysContent
ab_variantKeep a visitor in one test variantTest scriptNo expiryProduct
chat_tokenResume a chat the visitor openedChat widget24 hours, extended on reconnectSupport
consent_choiceRemember the banner answerConsent tool180 daysLegal

Step 4: classify each item under Article 5(3)

Classify by purpose, not by technology or by what a scanner labels it. The Article 29 Working Party's Opinion 04/2012 on the consent exemption gives the working tests: for the strictly necessary exemption, the feature would stop working without the item, and the user explicitly asked for that feature. Necessity is judged from the user's side, not the business's. An item used for several purposes is exempt only if every purpose is exempt.

ItemClassification for EEA visitorsReasonFix
cart_idExemptUser input cookie for a requested cartNone
csrf_tokenExemptProtects a service the user is usingNone
lb_routeExemptTransmission: picks the serverKeep it session-only
auth_sessionExemptAuthentication the user asked forAdd consent wording to any "remember me" option
langNot exempt as setWritten before any choice, kept 180 daysSet only when the visitor picks a language, and say so beside the control
stats_idNeeds consentThe Opinion says first-party analytics cookies are not covered by the two exemptions; some national regulators, such as France’s CNIL, exempt audience measurement under conditionsLoad only after consent, or move to a method you have assessed
ad_clickNeeds consentAdvertising is not exemptBlock until Accept
video_visitorNeeds consentThird-party tracking by an embedShow a placeholder until consent
ab_variantNeeds consentExperimentation is not requested by the userStart after consent
chat_tokenExempt if set only after the visitor opens chatResumes a requested conversationConfirm nothing is written before opening
consent_choiceCan be exemptRemembers the choice; the ICO gives consent-preference cookies kept over a period such as 90 days as an exampleKeep no identifier in it and justify 180 days

For UK visitors, stats_id and ab_variant could meet the statistical purposes exception if their sole purpose is aggregate statistics to improve the site and an objection route exists. The ICO's examples list A/B testing as likely to qualify and connecting a visitor ID to activity shared with advertisers as not.

Counting the sample for EEA visitors: before any choice, five items that are not exempt were present (lang, stats_id, ad_click, video_visitor, ab_variant). After Reject all, four were still there.

app.tapcub.com

Non-exempt items found in each run

sample course shop
Before any choice5 items
After Reject all4 items
Target after fixes, before choice0 items
Sample data
Sample data: 11 items observed on an example course shop; lang, stats_id, ad_click, video_visitor and ab_variant need consent or a change for EEA visitors, and only ad_click disappears after rejection.

Step 5: check lifetimes and third parties

Lifetime should match purpose. The Working Party's view is that an exempt cookie should expire once it is no longer needed, taking into account what an average user would expect. The ICO says the law sets no fixed durations but expects them to be proportionate, and notes that local storage may have no expiry at all.

Browsers add their own ceiling. Since version 104, Chrome caps cookie expiry at 400 days. In the sample, stats_id asks for 730 days. If set on 3 December 2026, Chrome would expire it on 7 January 2028, not in December 2028. Your inventory and privacy notice should state what actually happens, and the requested value should be shortened to what the purpose needs.

For third parties, record for each one:

  • the domain and the company behind it;
  • whether it uses the data for its own purposes or only on your instructions;
  • the contract or terms that cover it;
  • what happens to its cookies when a visitor withdraws consent.

Step 6: fix, document and schedule the next audit

Fix in this order:

  1. Anything that fires before a choice and is not exempt. In the sample: five items.
  2. Anything that survives rejection. Four items.
  3. Purposes nobody can explain. Remove video_visitor or get the supplier's documentation.
  4. Lifetimes. Shorten stats_id and give ab_variant an expiry in code.
  5. The banner. Rejecting should be as easy as accepting, and withdrawal as easy as giving consent. See consent banner design.
  6. The notice. List each technology, purpose, third party and duration.

Then rerun the three states and keep both reports with dates. The ICO guidance advises regular reviews, more often when you change technologies frequently. A practical rule is a quarterly run plus a check whenever a new tag, embed or SDK ships. Record who ran it and what changed. The privacy compliance checklist covers the duties beyond device storage, such as retention and access requests.

How the audit looks with TapCub installed

Suppose the course shop replaces stats_id with TapCub's website script. Run the same three states and this is what to expect and verify:

  1. Anonymous mode (the default for new projects). The website script writes neither a cookie nor local storage. If you call tapcub.consent() or an opt-out method, the choice itself is kept locally, so list it like consent_choice.
  2. Identified mode. A device ID is kept in local storage plus a cookie, at collection tier 3 and only after analytics consent where the site requires it. Treat it as needing consent in your inventory.
  3. Privacy signals. With Global Privacy Control or Do Not Track on, the script does not load unless the tag sets data-respect-dnt="false". Test with the signal on and off.
  4. Region rules. A new project has no region rules and does not require consent before collection. Where you need it, as in the EEA and the UK, add a region rule that requires consent in Configuration › Privacy center. Before consent the script holds events in memory or drops them, depending on the setting.
  5. Chat. After a visitor opens the chat window, the widget stores a conversation token in browser storage for 24 hours, extended on reconnect. Add it to the inventory.
  6. Extensions. If you switch on session replay or other add-ons, run the audit again; they load their own scripts.

No cookie is not the same as outside Article 5(3): the EDPB guidelines also consider access to IP addresses that originate from the user's device. Decide with counsel whether cookie-free measurement needs consent for your countries; do I need a consent banner lists the settings involved. TapCub does not scan your site for other vendors' cookies.

FAQ

Whenever the site changes what it loads, and on a regular schedule in between. A new marketing tag, video embed, chat tool or app release can add storage nobody listed. A workable rhythm is a quarterly pass plus a short check at each release that touches third-party code.

Yes. Browser developer tools show cookies, local storage, session storage and requests to other domains, which is enough for a small site if you follow a fixed path three times. Scanners help on large sites with many templates, but their purpose labels still need a person to check them.

A scan is the automated step that visits pages and lists what it finds. An audit adds the purpose of each item, who owns it, whether it appeared before consent, how long it lasts, the legal classification and the fixes. A scan cannot see features behind logins unless it is configured to.

Under the Article 29 Working Party's 2012 opinion they are not covered by the two ePrivacy exemptions, although it considered strictly aggregated first-party analytics low risk. Some national regulators have their own rules, and the UK now has a statistical purposes exception with conditions. Check the countries you serve.

Yes. Article 5(3) covers storing and accessing information on the device, whatever the mechanism. Local storage can keep identifiers with no expiry date, so record each key, its purpose and how it is cleared.

Sources

Filed underAnalytics

Was this article helpful?

We use your answers to fix and expand this page.

Emma Collins

Product Analyst

Focuses on event analysis, conversion funnels, and retention, using clear metric definitions and structured analysis to explain product performance.

Measure pages without writing a cookie by default

In anonymous mode the website script writes no cookie or local storage; region rules and privacy signals are set in one place.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics