GDPR First-Party Cookies: What Needs Consent, What Doesn't

GDPR First-Party Cookies: What Needs Consent, What Doesn't

GDPR first-party cookies are cookies your own website sets, and the GDPR does not give them a free pass. Whether you need consent depends on the cookie's purpose, not on who sets it. Strictly necessary cookies, such as a shopping cart or a login session, are exempt. Analytics, personalization, and marketing cookies need opt-in consent first, even when they sit on your own domain.

A first-party cookie is a small text file stored by the domain the visitor is actually on. A third-party cookie, by contrast, is placed by another domain, such as an ad network. Two EU rules apply to the first-party kind. The ePrivacy Directive requires consent before you store or read information on a device. The GDPR governs the personal data those cookies collect.

This guide explains why the rules reach your first-party cookies, which ones need consent, how to build a compliant setup, and which mistakes cause trouble. Nostra AI builds agents for ecommerce storefronts, including Edge ID for first-party tracking, so we see how consent choices shape what a store can measure. Nothing here is legal advice, but it will get you to the right questions.

Why the GDPR applies to first-party cookies

First-party does not mean exempt

The GDPR applies because a cookie often holds a unique identifier, and a unique identifier can be personal data. Recital 30 names cookie identifiers as online identifiers that can be used to profile and identify people. If your cookie lets you single out a returning visitor, you are processing personal data, whichever domain set it.

A second law sits on top. Article 5(3) of the ePrivacy Directive, known as the cookie law, requires consent before you store or access information on a user's device, whether or not that information is personal data. The ePrivacy rule decides if you need consent. The GDPR decides what valid consent looks like and how you handle the data afterward.

A cookie's purpose triggers the consent rule, not the domain that sets it.

Who has to comply, including US stores

The GDPR reaches any business that offers goods or services to people in the EU or monitors their behavior there, wherever the business is based. A US store that ships to Europe or targets European shoppers is in scope. The UK runs a parallel regime, UK GDPR plus PECR, with the same core consent logic.

A shipping box, a desk globe, and a small EU flag.

The US has no federal cookie consent law. State privacy laws such as the CCPA center on notice and opt-out rights, which is a different model. GDPR penalties can reach €20 million or 4% of worldwide annual turnover, whichever is higher. In 2021 France's CNIL fined Google and Facebook a combined €210 million, because refusing cookies on their own sites was harder than accepting them.

Which first-party cookies need consent

The strictly necessary exemption

A first-party cookie needs no consent only if it is strictly necessary to deliver a service the user explicitly asked for. That is the wording of the ePrivacy exemption. Holding items in a cart, keeping a user logged in, balancing server load, and protecting a session from fraud all qualify. Your own convenience, such as measuring which campaign sent the visit, does not.

A wire shopping cart with products, a brass key, and a padlock.

Exempt does not mean invisible. You should still tell visitors what these cookies do. If a necessary cookie holds personal data, the GDPR still applies, so you need a lawful basis such as contract performance or legitimate interest, plus a clear explanation in your privacy notice.

If the visitor's request would fail without the cookie, it is exempt. Otherwise, ask first.

Common first-party cookies compared

This table sorts typical first-party cookies on an ecommerce store by consent need.

First-party cookie What it does Consent needed?
Cart session Holds items while the visitor shops No, strictly necessary
Login or authentication Keeps the visitor signed in No, strictly necessary
Security and fraud protection Protects the requested service No, if used only for security
Consent record Remembers the banner choice No, strictly necessary
Language or currency choice Remembers a display setting Often yes if persistent
Analytics Counts visits and page views Yes in most EU countries
A/B testing and personalization Tests or tailors the experience Yes
Advertising or retargeting ID Feeds ad platforms Yes
Long-lived visitor ID Recognizes returning visitors Yes

Gray areas: analytics, preferences, and identity

Analytics cookies are the usual surprise. They are first-party and feel harmless, yet most EU regulators still require consent for them. A few, such as France's CNIL, allow a narrow exemption for strictly limited audience measurement. A standard GA4 setup should be treated as consent-based.

Preference and identity cookies split on duration and purpose. A language choice kept for the session is usually fine, while a persistent one is safer behind consent. A long-lived visitor ID, like the extended-life cookies Crumble's Edge ID supports, is not necessary for the service. It belongs behind consent, and recognition then depends on each visitor's consent settings.

How to make first-party cookies GDPR compliant

Audit what your site sets

Start by listing every cookie your site sets. Open Chrome DevTools, go to the Application tab, and expand Cookies for your domain. Load the homepage, a product page, and checkout in a fresh incognito window, once before and once after you interact with your banner. Include cookies added by apps and tag managers, because those are the ones teams forget.

A hub diagram showing four facts to record for each cookie during an audit.

Record four facts for each cookie, then assign it a category:

  • The cookie name and the script that sets it
  • Its purpose in plain language
  • Its lifetime
  • Its category: strictly necessary, preferences, statistics, or marketing

Set up consent, policy, and records

A compliant consent flow follows the same few rules on every site:

  1. Block every non-necessary cookie until the visitor opts in.
  2. Show Accept and Reject on the first layer, with equal prominence and no pre-ticked boxes.
  3. Offer choices by category instead of one all-or-nothing switch.
  4. Make withdrawing consent as easy as giving it, for example through a persistent footer link.
  5. Log each consent with a timestamp, the choices made, and the banner version.
  6. Keep the site usable for people who refuse non-essential cookies.

Consent only counts if refusing is as easy as accepting.

The GDPR never uses the phrase "cookie policy," but its transparency rules in Articles 12 to 14 require you to explain what you collect and why. A cookie policy is the standard way to do that. List each cookie's name, purpose, and lifetime, and update it whenever you add a tool. Regulators such as the CNIL also recommend keeping cookie lifetimes to about 13 months.

Mistakes that break first-party cookie compliance

Treating a first-party setup as a consent workaround

Moving a tracker onto your own domain changes who sets the cookie, not what it does. Server-side tagging, CNAME subdomains, and first-party proxies are legitimate engineering choices. A cookie that tracks marketing behavior still needs opt-in, though. Safari's ITP limits are browser rules, not legal ones, so beating them technically does not replace consent.

Choose tools whose behavior follows your consent state. Crumble's cookie lifespan, for example, depends on browser and consent settings, which is how a first-party identity tool should behave.

Changing the domain of a cookie never changes its legal category.

Four errors regulators keep finding

Most enforcement cases come down to a short list of repeat errors:

  • Firing analytics or ad cookies before the visitor clicks anything
  • Hiding Reject behind a "Manage preferences" link while Accept sits on the first layer
  • Labeling analytics or A/B testing cookies as strictly necessary
  • Citing legitimate interest as the basis for non-essential cookies, when ePrivacy requires consent

What to do next

Under the GDPR, first-party cookies come down to one question: does the visitor's request depend on this cookie? If yes, set it and explain it. If no, ask first, with a Reject button as easy to find as Accept. Audit what your site sets, sort each cookie by purpose, block the rest until consent, and keep records. Confirm country-specific details with privacy counsel, since regulators differ on edge cases such as analytics.

Consent also affects data quality. Once your banner and categories are right, the next problem is keeping fake traffic out of the data your opted-in visitors generate. See how Edge Protect filters bad bot traffic before it reaches your site and distorts your analytics.