On this page
What this issue is
When someone lands on your site, tags such as Google Analytics 4 and the Meta Pixel can save small files called cookies in their browser. _ga is the Google Analytics visitor ID. _fbp is the Meta browser ID used for ad measurement. If these appear before the visitor has made a choice in your cookie banner, cookies are being set before consent.
Why it costs you leads or sales
- Page loadsTags in the head start loading
- Tags fire_ga and _fbp written straight away
- Banner appearsVisitor has not chosen yet
- Visitor choosesToo late: cookies already exist
The tags run before the visitor has answered the banner.
How to check if your site has it
Open a clean session
Use a private or incognito window, or clear cookies for your domain first. Use an EU or UK location or VPN if your banner depends on region.
Open DevTools before loading
In Chrome press F12, go to Application, then Storage, then Cookies and select your domain. Keep it open.
Load the page and do not touch the banner
Look at the cookie list. Names like _ga, _ga_XXXXXXX, _gcl_au, _fbp, _ttp or _uetsid before any choice mean the problem is present.
Check the network tab too
In Network, filter for collect, facebook.com/tr or googleadservices. Requests sent before you click anything show tags firing early.
Repeat on a second page
Navigate to another page without answering the banner. Some setups only start tags on the next page view.
| Cookie | Set by | Purpose |
|---|---|---|
| _ga, _ga_<ID> | Google Analytics 4 | Visitor and session ID |
| _gcl_au | Google Ads / Tag | Ad conversion linking |
| _fbp | Meta Pixel | Browser ID for ad measurement |
| _ttp | TikTok Pixel | Browser ID for ad measurement |
| _uetsid, _uetvid | Microsoft (Bing) UET | Session and visitor ID |
How to fix it
Set the default before tags
Make sure your consent tool sets a default of denied (analytics_storage, ad_storage, ad_user_data, ad_personalization) on the Consent Initialization trigger, before any other tag.
Turn on consent checks
In Admin, Container Settings, enable consent overview. Then open each tag, go to Advanced Settings, Consent Settings and require ad_storage or analytics_storage as appropriate.
Fix the triggers
Move third-party pixels (Meta, TikTok, etc.) off the All Pages trigger onto a trigger that fires only after your consent tool signals acceptance.
Preview and publish
Use Preview mode, check the Consent tab shows denied on first load, then publish.
Find where tags are added
Check your theme header, any analytics or pixel plugin, and Google Tag Manager plugins. Hard-coded snippets load before consent.
Use your consent plugin's blocking
In your consent plugin settings, enable automatic script blocking or mark each script as needing the Statistics or Marketing category. Menu names vary by plugin.
Clear caches
Purge page cache and any CDN cache so old pages with the early scripts are not served.
Check Customer Privacy settings
In Settings, Customer privacy, set up the cookie banner and region rules so the Customer Privacy API controls tracking.
Review Customer events
In Settings, Customer events, set each pixel's permission to require marketing or analytics consent.
Remove hard-coded pixels
Search theme.liquid for pasted pixel code. It ignores consent settings. Move it into a managed pixel or wrap it in a consent check.
Find custom code
In Site settings, Custom code, look at the head and footer code for GA4 or pixel snippets.
Load tags through your consent tool
Remove direct snippets and load them through your consent tool or a Google Tag Manager container that respects consent.
Publish and retest
Publish the site and test in a clean browser.
Use the built-in banner and Marketing Integrations
In Settings, Cookie Banner, enable the banner. Add tracking through Marketing Integrations or Tracking & Analytics so Wix can apply the consent choice.
Avoid custom code in the head
Custom code added without a consent category may load right away. Set its category when you add it.
Enable the cookie banner
Go to Settings, Cookies & Visitor Data and turn on the banner with the right region setting.
Check Code Injection
Scripts pasted into Code Injection run regardless. Remove them and use the built-in analytics or pixel connections, or load them through a consent-aware tag manager setup.
Review tracking code locations
Check funnel and website Settings, Tracking Code (head and footer) for GA4 or pixel snippets, which run on load.
Load them through a consent tool
Remove direct snippets and load them from a tag manager or consent tool that waits for acceptance. Test each funnel step.
Set the default first
Add the consent default snippet above every tag, then load tags only after acceptance (see the code below).
Update on Accept
Call gtag consent update from your banner's accept handler, and load pixels at that moment.
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
ad_storage: 'denied',
analytics_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
wait_for_update: 500
});
</script>
<!-- load your Google tag / GTM snippet AFTER the block above -->
<script>
// call this from your banner's Accept button
function onAcceptAll() {
gtag('consent', 'update', {
ad_storage: 'granted',
analytics_storage: 'granted',
ad_user_data: 'granted',
ad_personalization: 'granted'
});
}
</script>Before
- _ga and _fbp present in Application, Cookies
- Requests to facebook.com/tr sent on load
- Banner is only decoration
After
- No analytics or ad cookies until Accept
- Pixel requests start only after consent
- Tags fire normally once the visitor accepts
How to confirm it's fixed
Test with no choice
In a fresh private window, load the page and check Application, Cookies. No _ga, _fbp or similar should exist.
Test Reject
Click Reject and reload. The cookies should still be absent and no pixel requests should appear in Network.
Test Accept
Click Accept. Cookies should now appear and the GA4 and ad platform requests should fire, including on your thank-you or purchase page.
Check conversions still record
Submit a test lead as an accepting visitor and confirm the conversion shows in your analytics and ad platform reports.
How to prevent it happening again
- Add every new pixel through one controlled place (tag manager or consent tool), never pasted into theme files
- Give each new tag a consent requirement before publishing
- Re-run the clean-browser cookie check after theme, plugin or tag manager changes
- Re-check after your consent tool updates or you change its categories
- Keep a list of the cookies your site is allowed to set before consent (strictly necessary only)
- Test from an EU or UK location as well as your own
How FunnelGuard handles this
Questions people ask
Why is my _ga cookie set before the visitor accepts cookies?
Your Google Analytics tag is loading on page load, not waiting for consent. This happens when the snippet is hard-coded in your theme, or the tag manager trigger fires on All Pages with no consent requirement. Set a denied default and require analytics_storage consent on the tag.
Is the _fbp cookie allowed before consent?
In regions with consent rules, such as the EU and UK, _fbp is a marketing cookie and generally needs prior consent. Block the Meta Pixel until the visitor accepts marketing cookies. Check with your legal adviser for your situation.
How do I check if cookies are set before consent?
Open a private window, open DevTools, go to Application, then Cookies, and load your site without touching the banner. If _ga, _fbp or similar cookies are listed, they were set before consent. Also check the Network tab for tracking requests.
Does Google Consent Mode stop cookies being set?
With analytics_storage and ad_storage set to denied, Google tags do not write their cookies, though they may send cookieless pings depending on your setup. Consent Mode does not control Meta, TikTok or other pixels, so block those separately.
Will blocking cookies until consent hurt my tracking?
You will not record visitors who decline, which is the intended effect. Visitors who accept should still be tracked. Test with Accept to make sure conversions and ad platform events still arrive after the fix.
Why do cookies still appear after I installed a cookie banner?
Most banners only display choices. They do not block scripts unless you set up blocking or consent-aware tags. Scripts pasted straight into the theme or code injection areas ignore the banner and run immediately.
Can FunnelGuard tell me if cookies are set before consent?
Only partly. FunnelGuard captures the cookies on your pages during a journey run, but it has no rule that flags pre-consent cookies. Use the manual clean-browser check to cover that gap.
Related issues
- TRK-282Consent banner shown but tags fire before any choiceFix guide
- TRK-283Tags still fire after visitor rejectsFix guide
- TRK-285Consent Mode default state not set before tags loadFix guide
- TRK-298CMP categorises analytics tag wrongly (necessary vs marketing)Fix guide
- TRK-296CMP script fails to load, blocking all tagsFix guide
- TRK-284Consent Mode v2 not implemented (no gcs/gcd)Fix guide