Shopify: visitors click Decline, but tracking keeps running
Your Shopify cookie banner records Decline, yet Meta, TikTok or Google still receive data. How to test it, the usual causes, and how to fix them.
Lukas Kontur · · 7 min read
A visitor clicks Decline (or whatever your banner calls the reject button) on your Shopify store. The banner disappears and the visitor assumes tracking is off. But on the next page, the Meta Pixel sends a PageView, Google Analytics sets _ga, or Hotjar keeps recording. This guide explains why a Decline click on Shopify sometimes only stops part of your tracking, how to prove it in your own browser, and how to close the gaps.
The symptoms
- A scan report lists trackers still active after reject or cookies still present after reject.
- After clicking Decline, the Meta Pixel Helper or TikTok Pixel Helper still shows events when you move to another page.
- A customer emails you saying "I declined cookies but your site still tracks me", sometimes with a screenshot of their browser tools.
This is the most common consent failure we measure. When we clicked Reject on EU websites and reloaded, non-essential cookies stayed on 48.3% of the 22,445 sites with a conclusive test (reject button study).
Corrected on 2026-10-21: this figure was re-measured from the stored scan results with stricter definitions (see the methodology).
How to check it yourself
- Open a new private window in Chrome and press F12. Click the Network tab.
- Load your store and click Decline (or Reject) on the banner.
- Click the "clear" icon in the Network tab so the list is empty, then reload the page.
- Filter for
facebook,tiktok,collect(Google Analytics) andhotjar, one at a time. Every request you see was sent after the visitor declined. - Open Application, Cookies, your store's address.
_fbp,_ttpor_gashould not be there after a Decline. - Click through to a product page and the cart, and repeat steps 4 and 5. Some leaks only show up on certain page types.
- For each request you find, click it and open the Initiator tab. It tells you which file sent it. A file from your theme (for example
theme.liquidcontent or a file under/cdn/shop/t/) points to pasted code. A request coming from a sandbox frame points to a pixel.
Why it happens
Code in the theme does not listen to the banner
Shopify's banner tells Shopify's pixel manager what the visitor chose, and the pixel manager holds back web pixels (app pixels and custom pixels) accordingly. A tracking script pasted into theme.liquid is not a web pixel. Unless it checks consent itself, it runs on every page, whatever the visitor clicked. Shopify says web pixels "always respect your store's privacy settings" and that stores whose old setup did not may see fewer tracked events after migrating (Shopify Help: pixel migration). That drop in events is the Decline finally working.
A custom pixel has "Permission: Not required"
Custom pixels with Not required run regardless of consent (Shopify Help: manage custom pixels).
The banner app does not pass the choice to Shopify
Third-party consent apps "must sync consent to Shopify through the Customer Privacy API" (Shopify Help: app pixels). If yours does not, Shopify never learns about the Decline. If its regions differ from Set custom banner regions in Shopify, some visitors get a banner that Shopify ignores.
Old checkout scripts
Shopify has phased out checkout.liquid and the "Additional scripts" box for the thank-you and order status pages (Shopify developer docs: checkout.liquid). Since August 28, 2025 the additional scripts section in the checkout settings is view-only (Shopify Help: checkout upgrade). If your store still shows tracking code there, move it to a pixel; do not rely on it either way.
Server-side event sharing
The Meta and TikTok apps offer higher data-sharing levels that also send events from server to server (Meta's Conversions API, TikTok's Events API) (Shopify Help: Meta data sharing, TikTok Ads Help: data sharing). Shopify states that server pixels "are still subject to your store's customer privacy and consent settings" (app pixels page above). You cannot see server-to-server traffic in DevTools, so for these, rely on the app and Shopify's settings rather than your own browser test.
The fix
Step 1: make sure Shopify knows about the Decline
- Shopify's own banner: go to Settings, Customer privacy, Cookie banner and confirm it is active for the regions you sell to (Shopify Help: customer privacy settings).
- A consent app: confirm in its documentation or with its support that it syncs consent through the Customer Privacy API, and that Set custom banner regions in Shopify matches the app's regions.
Step 2: move tracking out of the theme
Go to Online Store, Themes, three dots, Edit code. In theme.liquid and in your sections and snippets, search for fbq(, ttq., gtag(, googletagmanager.com and hotjar. For each match:
- If the vendor has an official Shopify app, use the app and delete the snippet.
- Otherwise, create a custom pixel under Settings, Customer events, paste the code there, set Permission to Required, choose Marketing or Analytics, then delete the snippet from the theme.
Step 3: if code must stay in the theme, check consent first
Some scripts cannot run in a pixel sandbox, for example a chat widget that needs to draw on the page. A developer can make such a script wait for consent with the Customer Privacy API. The method names below come from Shopify's Customer Privacy API reference:
<script>
(function () {
var loaded = false;
function loadTracker() {
if (loaded) return;
loaded = true;
// Paste the vendor's loader code here.
}
window.Shopify.loadFeatures(
[{ name: 'consent-tracking-api', version: '0.1' }],
function (error) {
if (error) return;
if (window.Shopify.customerPrivacy.marketingAllowed()) loadTracker();
}
);
document.addEventListener('visitorConsentCollected', function (event) {
if (event.detail.marketingAllowed) loadTracker();
});
})();
</script>
Use analyticsProcessingAllowed() and event.detail.analyticsAllowed instead for analytics tools. Note that this only stops the script from starting. If a visitor first accepts and later changes their mind, a script that is already running keeps running until the next page load. That is one more reason to prefer pixels.
Step 4: check every custom pixel's permission
Under Settings, Customer events, open each custom pixel and set Permission to Required with the right purpose. Leave Not required only for code that genuinely does not track visitors.
Step 5: use the vendor's consent switch where you load code yourself
If you load the Meta Pixel code yourself (inside a custom pixel or a consent-checked theme script), Meta documents fbq('consent', 'revoke') before fbq('init', ...) and fbq('consent', 'grant') after consent (Meta: GDPR implementation). TikTok lists a pixel consent mode in its help centre (TikTok Ads Help); check TikTok's current developer docs for the exact calls before using it.
How to verify the fix
- Decline test: new private window, click Decline, clear the Network list, reload. No requests for
facebook,tiktok,collectorhotjar. No_fbp,_ttpor_gacookie. Repeat on a product page and the cart. - Reload test: close the tab, open the store again in the same private window. The banner should stay closed and tracking should stay off. If cookies come back now, you have consent respawn: something sets them again on every page load.
- Accept test: new private window, click Accept. The pixels and cookies should appear, so your ad reporting still works for visitors who agree.
- Pixel test: for custom pixels, use Test under Settings, Customer events and confirm the Shopify Pixel Helper shows "Pixel is awaiting consent" before you accept (Shopify Help: testing).
If pixels already fire before anyone clicks the banner, start with Shopify: pixels fire before the cookie banner. For the background, see Pre-consent tracking explained.
Check your site in 1 minute
Our free scan clicks Reject on your banner, reloads your store and reports every tracker and cookie that should have stopped but did not. No signup needed. Run a free scan.
Get alerted when it breaks
A new app, a theme update or a change in your consent app can undo a working Decline. With monitoring, we repeat the reject test on a schedule and email you when tracking survives a Decline again. Create an account and add your store.
Last updated: