Pre-consent cookies: the biggest compliance risk for ecommerce in 2026
Of all the ways an ecommerce store can fail a cookie compliance audit, pre-consent cookies are the most common, the most easily detected and the most likely to trigger enforcement action. They are also the most fixable, once you understand what they are and where they come from.
A pre-consent cookie is any cookie set on a visitor's browser before that visitor has interacted with your consent banner. The issue is not that the cookie exists. The issue is timing: cookies that require consent must not be placed until the user has actively said yes.
Regulators across Europe have invested in automated scanning infrastructure that visits websites just like a real user would, with no prior cookies, and records every cookie set before any consent interaction takes place. The evidence is binary and unambiguous. Either the cookie was there before consent, or it was not.
Shein was fined 150 million euros by France's CNIL in 2024. A significant part of that fine related to cookies being set before visitors had any opportunity to consent. That case is not an outlier. It is the clearest high-profile example of a pattern of enforcement that has resulted in hundreds of fines across the EU over the past three years.
What pre-consent cookies are
When a visitor arrives at your store for the first time, they have a fresh browser with no cookies from your domain. Your page loads. During that loading process, scripts run. Some of those scripts set cookies.
If your consent banner appears on screen but the visitor has not yet clicked anything, and during that period a tracking or advertising cookie is set, that cookie is a pre-consent cookie. The visitor's browser has been modified with tracking technology before they have given any permission for that to happen.
This matters because under GDPR Article 6 and Article 7, processing personal data requires a lawful basis. For marketing cookies, the required lawful basis is consent. Consent must be freely given, specific, informed and unambiguous. It must be an affirmative action: a pre-ticked box or passive continuation of browsing does not qualify as consent.
Setting a cookie that tracks a visitor before they have provided that affirmative consent is a violation of GDPR. Under the ePrivacy Directive, which applies alongside GDPR in EU member states, it is also a direct violation of the requirement to obtain prior consent before accessing or storing information on a user's device.
Why regulators treat this as the number one trigger
Pre-consent cookies have become the dominant enforcement trigger for several reasons.
First, detection is fully automated. Regulators do not need a user complaint. They run crawlers that visit thousands of websites, record all cookies set on first page load before any consent interaction and flag any non-essential cookies found at that stage. The process is systematic and scalable. A single regulatory authority can audit tens of thousands of sites per year using this approach.
France's CNIL has been explicit about its automated cookie scanning program. The Netherlands' AP, Spain's AEPD and Germany's DSK have all deployed or described similar infrastructure. The European Data Protection Board has coordinated cross-border enforcement actions specifically targeting cookie consent failures, with pre-consent cookies as the primary finding in most cases.
Second, the evidence is clean. When a crawler records a cookie set before consent, there is no ambiguity about what happened. There is a timestamp for the cookie creation and a timestamp for any consent interaction. If the cookie timestamp precedes any consent interaction, the violation is established by the technical record alone.
Third, the volume of non-compliant sites is enormous. Studies consistently find that 70-85% of ecommerce sites with consent banners still set at least one non-essential cookie before consent is recorded. This gives regulators a large pool of enforcement targets and means that any store that has not specifically audited its pre-consent cookie behavior should assume it is likely non-compliant.
In the US, the same technical behavior drives exposure under CIPA class actions. As covered in our post on CIPA cookie lawsuits for ecommerce, plaintiffs' firms use the same automated detection approach to identify stores that load tracking scripts before consent and file class actions seeking $5,000 per California visitor.
Common causes of pre-consent cookies
Understanding where pre-consent cookies come from is essential for fixing them. There are four primary causes.
Tag managers firing before the CMP loads
This is the most common cause. Google Tag Manager, Adobe Launch, Tealium and similar platforms fire configured tags when the page loads. If the tag manager fires before the consent management platform has loaded and evaluated the visitor's consent state, every tag configured in the tag manager will execute and potentially set cookies before consent is recorded.
The script loading order in your page head determines whether this happens. If your tag manager script tag appears in the HTML before your CMP script tag, the tag manager will start firing before the CMP is ready. Even a few hundred milliseconds of difference can result in tracking cookies being set before consent.
CMP misconfiguration
A consent management platform that is installed but incorrectly configured will not block pre-consent cookies. Common misconfigurations include: setting tracking categories to "on" by default rather than "off"; failing to categorize specific cookies under the correct consent categories; not connecting the CMP to the tag manager's consent mode API; and implementing auto-accept banners that record consent without actual user interaction.
Some CMPs are configured by agencies or developers who prioritize conversion rate on the consent banner over compliance. Default-on configurations maximize the number of visitors who are tracked but fail to meet the consent requirements of GDPR.
Platform default cookies and app-injected scripts
Ecommerce platforms and their app ecosystems inject scripts and cookies outside the control of your tag manager. Shopify's own marketing and analytics integrations, third-party apps installed from the Shopify App Store and platform-level features like Shopify Audiences all set cookies through mechanisms your CMP may have no visibility into.
When a Shopify app injects a tracking pixel directly into your storefront JavaScript, that pixel fires independently of your tag manager and independently of your CMP. Unless your CMP has specific integration with that app or uses a network-level blocking approach, the app's cookies will be set before consent.
Third-party apps and widgets
Live chat widgets, review platforms, loyalty programs, upsell tools and other ecommerce apps all set their own cookies. These tools are often installed by marketing or operations teams without input from whoever manages consent configuration. Each new app installation potentially creates new pre-consent cookies.
This category of pre-consent cookies tends to grow over time as stores add new apps and integrations without auditing the cookie impact of each addition.
Specific cookie names to look for
When auditing your store for pre-consent cookies, the following specific cookie names and patterns indicate tracking scripts that are firing before consent.
Meta (Facebook): _fbp
The _fbp cookie is set by the Meta Pixel when it fires on page load. It is a first-party cookie that stores a unique identifier used for Facebook advertising attribution. Meta's pixel integration is one of the most common sources of pre-consent cookies on ecommerce sites. If you see _fbp in the cookie jar before any consent interaction, your Meta Pixel is firing before consent.
Google Analytics: _ga and _gid
The _ga cookie stores a unique client identifier for Google Analytics. The _gid cookie stores a session identifier. Both are set when the Google Analytics or Google Tag Manager script fires. These are analytics cookies that require consent under GDPR. If you see _ga or _gid before consent, your analytics implementation is non-compliant. Google's own consent mode documentation explains how to configure GA4 to operate in a consent-pending state without setting these cookies until consent is granted.
Criteo: criteo_* patterns
Criteo sets multiple cookies using the criteo_ prefix, including criteo_write_test and criteo_v2. These cookies support Criteo's retargeting infrastructure. If any criteo_ cookie appears before consent, the Criteo tag is firing without a consent gate. Criteo was fined 40 million euros by France's CNIL in 2023 specifically for processing data without valid consent, so this is a vendor regulators already have on their radar.
Xandr and AppNexus: anj, uuid2, uids
Xandr's real-time bidding infrastructure sets cookies named anj, uuid2 and uids. These are set from the domain adnxs.com. Their presence before consent indicates that an Xandr advertising tag is loading before the user has agreed to tracking. Xandr cookies are also among the most frequently cited in CIPA class action complaints in the US.
RTB and programmatic: rtb*, td_*
Cookies matching rtb* patterns come from various real-time bidding platforms. The td_* prefix is associated with Treasure Data and similar data management platforms. Any cookie matching these patterns appearing before consent indicates an advertising infrastructure integration that is not properly gated. RTB platforms receive user data in milliseconds as pages load, before any banner interaction, which is why they appear in both GDPR enforcement findings and CIPA complaints.
Platform essential cookies that are allowed before consent
Not every cookie that appears before consent is a violation. Strictly necessary cookies that are essential for the website to function do not require consent under the ePrivacy Directive. For ecommerce stores, the following cookies are generally considered strictly necessary and do not need to wait for consent.
Shopify session and cart cookies: _shopify_s, _shopify_y, _shopify_sa_p, _shopify_sa_t and cart tokens like cart and _cart_currency are essential for the store to function. They maintain session state, preserve cart contents and support the checkout process. These are first-party cookies set by the platform itself, not by tracking scripts.
Security and fraud prevention cookies set by Shopify or your payment processor to protect against CSRF attacks and fraud are also considered strictly necessary. CAPTCHA-related cookies from services like reCAPTCHA that protect login and checkout forms fall into the same category.
Load balancing and CDN cookies that route users to the correct server instance do not require consent. Session authentication cookies that keep a logged-in user authenticated during their visit are strictly necessary.
The key distinction is function: strictly necessary cookies exist to serve the user's immediate request. Tracking, analytics and advertising cookies exist to serve the business's marketing and measurement needs. Only the latter category requires consent.
The three-state test methodology
The standard method for auditing pre-consent cookies is the three-state test. It evaluates your store in three distinct states: before any consent interaction, after a user has explicitly rejected non-essential cookies and after a user has accepted non-essential cookies. For a detailed walkthrough, see our guide on how to check pre-consent cookies on your store.
State 1: pre-consent capture
Open your store in a fresh incognito browser window. Open developer tools before navigating. Go to the Application tab and select Cookies in the left panel. Navigate to your homepage. Record every cookie that is set before you interact with the consent banner in any way. This is your pre-consent cookie list.
Any cookie in this list that is not strictly necessary is a violation. Essential Shopify platform cookies and security tokens are acceptable. Analytics cookies like _ga and advertising cookies like _fbp are not.
State 2: post-reject
From the same session, click reject or decline on the consent banner. Record which cookies are set after this interaction. The only cookies that should exist at this point are strictly necessary cookies. If additional tracking or analytics cookies are set after a user has explicitly rejected consent, this is a serious violation. It indicates your CMP is not properly blocking scripts when consent is refused.
State 3: post-accept
Reload in a fresh incognito window. This time, accept all cookies on the consent banner. Record the full set of cookies now present. This state represents what your store legitimately needs when a user has consented. Compare the post-accept cookie list against your cookie policy to verify that every cookie now set is disclosed and categorized correctly.
Gaps between your declared cookies and your actual post-accept cookies indicate undisclosed tracking, which is a separate compliance issue from pre-consent loading.
How to fix pre-consent cookies
Fix the CMP script loading order
Your CMP script must load and execute before any tag manager or tracking script. In your page head, the CMP script tag must appear before the Google Tag Manager snippet or any other script that fires marketing and analytics tags. Verify the order in your theme layout file and in any app-injected scripts. The CMP needs to run first so it can intercept tag execution and block tags until consent is confirmed.
Integrate tag manager with consent mode
Google Tag Manager supports consent mode, which allows your CMP to pass consent signals to GTM and configure tag firing rules based on consent state. Set up consent mode in GTM and configure every marketing and analytics tag with appropriate consent type requirements. Tags requiring analytics_storage consent should not fire until that consent is granted. Tags requiring ad_storage consent should wait for advertising consent.
For non-Google tag managers, check whether your platform has a native consent API and configure it similarly. The goal is that the tag manager itself refuses to fire non-essential tags until it has received a positive consent signal from the CMP.
Audit and remediate hardcoded scripts
Search your theme files for hardcoded pixel tags. Common locations: the <head> section of your layout template, the order status page (Shopify's additional scripts section), cart page templates and any app block content. Move hardcoded pixels into your tag manager under proper consent control. If a script cannot be moved to the tag manager, wrap it in a consent check using your CMP's JavaScript API: only execute the script if the user has accepted the relevant consent category.
Adopt server-side tagging for high-risk vendors
Server-side tagging moves the execution of tracking scripts from the user's browser to a server you control. Instead of the Meta Pixel firing in the browser and setting _fbp directly, your server receives the event and forwards it to Meta's Conversion API after verifying that the user has consented. This eliminates the browser-side pre-consent cookie risk for supported vendors while maintaining measurement capability.
Server-side tagging requires more infrastructure than client-side implementation, but it provides stronger compliance guarantees because cookie-setting behavior is controlled server-side where your consent logic runs first. It also improves data quality by bypassing browser-based ad blockers.
Establish a cookie governance process
Pre-consent cookie issues recur because new tools are added without consent review. Establish a process requiring that any new app, pixel or integration be reviewed for cookie behavior before installation. Document the cookies set by each tool, categorize them and ensure each category maps to a consent category in your CMP.
Complyko's continuous monitoring scans your store on a regular schedule and alerts you when new pre-consent cookies appear, catching the drift that happens when apps are added or updated without consent review. See our post on cookie drift in ecommerce for more on this problem.
What the Shein fine tells us about enforcement direction
Shein's 150 million euro fine from France's CNIL in October 2024 was one of the largest cookie-related penalties ever issued. The CNIL found multiple violations including cookies set before consent, difficulty opting out and inadequate information about cookie purposes.
The scale of the fine reflected Shein's size and the volume of French users affected. But the underlying violations, particularly the pre-consent cookie finding, are identical to what the CNIL finds on mid-market stores. The difference is that Shein's violation affected tens of millions of users, which drove up the fine calculation.
The enforcement direction is clear. Regulators have invested in scalable automated detection tools. They are systematically working through categories of sites. Mid-market ecommerce is not too small to attract enforcement attention, particularly when violations are detected automatically rather than requiring a manual investigation.
For more context on common mistakes that lead to these findings, see our post on GDPR cookie consent mistakes in ecommerce.
Getting a complete picture
Manual browser-based testing gives you a snapshot of a few pages at a point in time. A complete pre-consent cookie audit covers every page type in your store: homepage, product pages, collection pages, cart and the full checkout flow. It also covers the post-reject state, which manual testing tends to skip.
Automated scanning tools visit your store with fresh sessions, record all cookies at each consent state and produce a report that maps every pre-consent cookie to the script that set it. This is the same approach regulators use for detection and the same approach plaintiffs' firms use to identify CIPA targets.
Running the same audit before regulators do gives you the opportunity to fix violations before they become enforcement findings.
Frequently asked questions
Complyko scans your store for pre-consent cookies across every page type, including checkout. You get a full report showing which cookies fire before consent, which scripts set them and what needs to change.
Get your free pre-consent cookie audit →