On this page
What this issue is
Under GDPR, UK GDPR and the ePrivacy rules, non-essential cookies and similar tracking (analytics, advertising, remarketing) generally need the visitor's consent first. Tracking fires before consent means your site sends tracking requests to platforms such as Google, Meta or TikTok before that consent exists. It also covers the case where the visitor clicked Reject and the tags still ran.
Why it costs you leads or sales
The direct risk is regulatory and reputational: complaints, fines and distrust from visitors who chose to refuse tracking. There is also a data cost. Platforms may receive data you should not hold, which can force you to clean up audiences and reports.
- Visitor landsPage loads, banner appears
- Tags fireGA4, Ads, Meta send hits before any choice
- Visitor clicks RejectChoice is recorded too late
- Data already sentPlatforms hold data without consent
The break is the tags loading before the visitor has answered the banner.
When the banner is wired correctly, tags wait for the visitor's choice.
How to check if your site has it
Open a clean session
Use a private window with extensions off, ideally with a VPN or setting that shows the EU or UK banner.
Open DevTools before loading
Press F12, go to the Network tab and tick Preserve log. Then load your page without touching the banner.
Look for tracking requests
Filter for collect, g/collect, googleads, doubleclick, facebook.com/tr, analytics.tiktok.com and similar. Any request before you click means tags fire pre-consent.
Check cookies
In Application > Cookies, look for _ga, _gcl_au, _fbp and similar before you choose anything.
Repeat after clicking Reject
Reload, reject, and browse a couple of pages. Marketing requests should stay absent.
How to fix it
The principle is the same everywhere: default every non-essential category to denied, and let tags run only when the matching consent is granted. Pick your platform below.
Set default consent to denied
Use your CMP's Google Tag Manager template and make sure it fires on the Consent Initialization trigger, before any other tag, with analytics_storage, ad_storage, ad_user_data and ad_personalization set to denied by default.
Turn on consent checks in tags
In Tag > Advanced Settings > Consent Settings, require ad_storage for ad tags and analytics_storage for analytics tags. For tags without built-in checks, choose Require additional consent.
Remove consent-free triggers
Check that no Custom HTML tag with a pixel fires on All Pages without a consent condition.
Preview and test
Use Tag Assistant preview and check the Consent tab shows denied on the first page view.
Use a consent plugin that blocks scripts
Pick a consent plugin that blocks scripts by category, not only shows a banner, and enable its automatic blocking.
Find hard-coded pixels
Search your theme header, the Insert Headers and Footers area and marketing plugins for pasted GA4, Meta or TikTok code. Move them into your tag manager or the plugin's consent-aware settings.
Check plugin integrations
In plugins such as Site Kit, WooCommerce tracking or Meta add-ons, look for a consent setting and enable it.
Use Customer Privacy settings
In Settings > Customer privacy, set the region rules so the EU and UK require consent, and enable the banner.
Check apps and pixels
In Settings > Customer events, check each pixel's permission setting so marketing and analytics require consent.
Remove pasted scripts
Look in theme.liquid for pasted tracking snippets and move them to Customer events or a consent-aware app.
Move scripts out of Custom Code
Scripts in Project Settings > Custom Code run on load. Remove direct pixels and load them through a tag manager with consent checks, or through your CMP.
Block by category in your CMP
Mark each remaining script with your CMP's category attributes so it stays blocked until consent.
Review tracking code
Check Settings > Tracking Code for the funnel or site, and the funnel step custom code areas, for pasted pixels.
Gate scripts
Load them through a tag manager or CMP that blocks until consent, instead of loading them directly.
Use the built-in banner and categories
Turn on the cookie banner in Settings and assign custom tracking scripts to the right category in Settings > Custom Code, so they only load once that category is accepted.
Enable the cookie banner
In Settings > Cookies and Visitor Data, turn on the banner and set the behaviour for EU and UK visitors.
Check code injection
Pixels pasted in Code Injection can run regardless. Move them into your tag manager with consent rules.
Set denied defaults first
Put the consent default call above every Google tag, then update it when the visitor chooses. See the snippet below.
Load other pixels on consent only
Inject the Meta, TikTok or other scripts only inside the callback that runs after consent.
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
analytics_storage: 'denied',
wait_for_update: 500
});
</script>
<!-- Load your tag manager or gtag.js AFTER this block -->
<script>
// Call this from your banner when the visitor accepts
function onConsentGranted() {
gtag('consent', 'update', {
ad_storage: 'granted',
ad_user_data: 'granted',
ad_personalization: 'granted',
analytics_storage: 'granted'
});
}
</script>Before
- Tags load on page view
- Banner choice is recorded but ignored
- Cookies like _ga and _fbp appear instantly
After
- Defaults set to denied
- Tags wait for the matching category
- No tracking requests until Accept
How to confirm it's fixed
- Fresh private window shows no tracking requests before you click the banner
- No _ga, _gcl_au, _fbp or similar cookies before consent
- After Reject and a reload, still no marketing or analytics requests
- After Accept, tags fire once and conversions still arrive in GA4, Ads and Meta
- Tested on your key pages and on form thank-you pages
- Tested on mobile and from an EU or UK location
How to prevent it happening again
Most regressions come from someone adding a new pixel, plugin or theme update outside the consent setup. Keep one rule: every new tag goes through the tag manager or CMP, with a consent requirement set when it is added.
- Keep one owner for tags and consent settings
- Review the tag list every quarter and after each redesign
- Re-run the DevTools test after plugin, theme or CMP updates
- Never paste pixel code directly into themes or page builders
- Run an automated check on a schedule
How FunnelGuard handles this
FunnelGuard detects this today. Its consent-denied check loads your journey as a robot visitor who refuses consent, then looks at which tracking hits go out to platforms such as GA4, Google Ads, Meta, TikTok, LinkedIn, Bing, Pinterest, Snapchat, X and Reddit. If tracking still fires with consent denied, it is flagged.
Questions people ask
Why is my tracking firing before cookie consent?
Usually a tag is loaded outside your consent tool, for example a pixel pasted in the theme, a plugin that injects it, or a tag manager trigger with no consent condition. The banner records the choice but nothing tells the tags to wait.
How do I check if GA4 fires before consent?
Open a private window, open DevTools, go to the Network tab and load your site without clicking the banner. Filter for collect or google-analytics. Any request before you choose means GA4 is firing without consent.
Does Google Consent Mode stop tags firing before consent?
Consent Mode lets Google tags adjust their behaviour based on a denied or granted signal, so with denied defaults they limit cookies and identifiers. It does not control other vendors' pixels, so Meta, TikTok and others still need to be blocked or gated separately.
How do I stop the Meta pixel loading until consent?
Load the pixel through your tag manager with a consent requirement, or through a CMP that blocks it by category. Remove any copy pasted directly in your theme, or it will still load.
Do I need consent before loading Google Analytics in the EU or UK?
In most cases analytics cookies need consent under ePrivacy rules, though some countries allow limited exemptions. Check the rules where you operate and ask a privacy professional if unsure.
Why do tags still fire after I click Reject?
The reject choice is probably not wired to the tags, or a hard-coded script ignores it. Check tag consent settings in your tag manager and remove scripts that sit outside it.
Can FunnelGuard tell me if tracking fires before consent?
Yes. Its consent-denied check runs your journey as a robot that refuses consent and flags tracking hits that still go out to ad and analytics platforms. You get an alert with a screenshot and a likely cause.
Related issues
- OPS-319No cookie banner for EU/UK visitorsFix guide
- OPS-323Consent Mode v2 not implementedFix guide
- OPS-324Consent not honoured after reject (pixels still fire)Fix guide
- OPS-328CMP script failing so no tags load at allFix guide
- OPS-337Session recording without consentFix guide
- OPS-339Third-party embeds (YouTube, Maps) setting cookies before consentFix guide