On this page
What this issue is
A visitor clicks your ad and lands on a URL like /offer?utm_source=google&utm_medium=cpc&gclid=abc123. A consent banner appears. When they click Accept, the banner (or a script it triggers) reloads the page, or sends them to the same path without the query string.
After the reload, the address is just /offer. The UTM parameters (tags that say which campaign sent the visitor) and the click IDs (codes that let ad platforms match a conversion to an ad click) are gone. Tags that load after consent now see a visitor with no source.
It happens most with consent tools set to reload so that blocked scripts can load, with custom redirect rules, and with caching or language plugins that normalise URLs.
Why it costs you leads or sales
The visitor still converts, but the credit goes to the wrong place. Your ad platforms cannot match the sale to the click, and analytics files it under direct or unassigned. Smart bidding then learns from fewer conversions and you may cut campaigns that work.
The people most affected are those who accept cookies, the visitors you can track. So the loss hits exactly the traffic you were hoping to measure.
- Ad clickURL carries utm_* and gclid
- Banner AcceptPage reloads without the query string
- Tags loadNo source or click ID to read
- ConversionReported as direct or unassigned
The visitor converts normally, but the data that ties the sale to the ad is dropped at the banner.
Example: 100 paid-ad conversions in a week. When the banner reload strips parameters, fewer are credited to the campaign that earned them.
How to check if your site has it
Open a private window
Use a clean session so no consent choice is stored. If you are in a region where the banner is geo-targeted, test from there or with the tool's preview mode.
Visit a tagged URL
Load your landing page with
?utm_source=test&utm_medium=cpc&utm_campaign=banner-check&gclid=TEST123added.Watch the address bar
Click Accept (then repeat with Reject). If the page flashes and the address becomes the plain URL, the banner is stripping parameters.
Check the Network tab
In browser developer tools, open Network and tick Preserve log. Look for a second document request to your page without the query string right after you click.
Inspect the first tag hit
Filter for
collect(GA4) or the Google Ads request. Check whetherdl(page location) still contains your UTMs and gclid.
How to fix it
There are two ways to fix it, and the safest is to use both. First, stop the banner from reloading the page. Second, capture the parameters on landing and store them in first-party storage, so they survive any reload or redirect.
Turn off reload-on-consent
In your consent plugin's settings (names vary, for example a 'reload page after consent' option), disable the reload and use its script-unblocking mode instead.
Check URL-rewriting plugins
Look at redirect, cache and multilingual plugins for rules that strip query strings, and make sure they pass them through.
Add the capture script
Add the snippet below in the header with a code-snippet plugin or your child theme.
Review the banner app
In your consent app's settings, disable any page reload after the visitor chooses. Shopify's own Customer Privacy API does not need one.
Add the capture script
In Online Store > Themes > Edit code, add the snippet to
theme.liquidbefore</head>.
Fire a capture tag early
Create a Custom HTML tag with the snippet below. Trigger it on Initialization - All Pages so it runs before the banner can act.
Read the stored values
Create variables that read the saved values and pass them to your conversion tags and form hidden fields.
Check consent settings
Set the tag's consent requirements to match the storage category you chose.
Check the banner embed
If the consent tool is added in Project Settings > Custom Code, look for its reload option and turn it off.
Add the capture script
Paste the snippet in Project Settings > Custom Code > Head code, above the consent script, and publish.
Add the script to the funnel
In the funnel or website settings, open Tracking Code > Header and paste the snippet above any consent script.
Disable reload in the banner
If you use a third-party consent tool, turn off its page reload option.
Use the built-in banner
Wix's cookie banner under Settings > Cookie Consent Banner is designed to avoid forcing a reload. If you added a third-party tool, check its reload option.
Add the capture script
In Settings > Custom Code, add the snippet to the Head of all pages.
Check the banner setup
If you use a third-party consent tool, turn off its reload option.
Add the capture script
In Website > Pages > Custom Code > Header (Code Injection), paste the snippet.
Remove the reload call
Search your code for
location.reload()orlocation.href = location.pathnamein consent callbacks and delete it. Load scripts dynamically instead.Fix server redirects
Make sure any rewrite or redirect rule keeps the query string (see the nginx example below).
(function () {
var keys = ['utm_source','utm_medium','utm_campaign','utm_term','utm_content','gclid','fbclid','msclkid','ttclid'];
var params = new URLSearchParams(window.location.search);
var saved = {};
try { saved = JSON.parse(sessionStorage.getItem('campaign_params') || '{}'); } catch (e) {}
var found = false;
keys.forEach(function (k) {
if (params.get(k)) { saved[k] = params.get(k); found = true; }
});
if (found) {
sessionStorage.setItem('campaign_params', JSON.stringify(saved));
}
})();# $is_args$args keeps ?utm_source=... on the redirect
location = /old-offer {
return 301 /offer$is_args$args;
}Before
- Accept triggers a page reload
- URL becomes /offer with no query string
- Conversion shows as direct
After
- Accept loads tags without reloading
- URL keeps utm_* and gclid
- Conversion credited to the campaign
Ad click → yoursite.com/offer?gclid=Cj0KCQ…&utm_source=google&utm_campaign=spring
301 redirect
Lands on → yoursite.com/offer/
- gclid
- utm_source
- utm_campaign
The URL loses utm_* and gclid, and the sale is reported as direct.
Toggle the cause to see how a single reload changes what your tags receive.
How to confirm it's fixed
- Repeat the manual test with a fresh private window and a tagged URL
- After Accept, the address bar still shows your UTMs and gclid, or they are in storage
- After Reject, the same is true and no marketing tags fire
- The first GA4 hit shows the campaign source and medium in its page location
- A test conversion appears in your reports under the test campaign, not as direct
- Test on mobile and in at least two browsers
How to prevent it happening again
Banner settings change when a plugin updates, when someone switches consent tools, or when a developer adds a redirect. Re-run the tagged-URL test after any change to your consent tool, caching, redirects or theme.
- Add 'test with a tagged URL' to your release checklist
- Review redirect and rewrite rules for query-string handling
- Re-test after consent tool or plugin updates
- Keep one named owner for the consent setup
- Monitor the journey on a schedule instead of testing by hand
How FunnelGuard handles this
FunnelGuard detects this today. Its UTM persistence check lands on your page as a robot visitor with campaign parameters in the URL, then follows the journey and checks whether those parameters are still there after the banner interaction, reloads and redirects. If they disappear, the check fails.
A failure is re-checked from a second region before one alert goes out by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause. Test traffic is marked (utm_source=funnelguard, fg_test=1, an fg_test cookie and its own user agent) and never clicks real ads. The Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans have a 3-day free trial.
Questions people ask
Why do my UTMs disappear after I accept the cookie banner?
Most often the consent tool reloads the page or redirects to the same path without its query string after the visitor chooses. A redirect rule, cache or language plugin that normalises URLs can do the same. Turn off the reload and test again with a tagged URL.
Why is my gclid missing after the consent banner reloads the page?
The reload requests the page again without ?gclid=..., so the value is no longer in the address when tags load. Stop the reload, or save the gclid in first-party storage on landing so your tags can still read it.
How do I stop a cookie banner from reloading the page?
Open your consent tool's settings and turn off options such as reload page after consent. Use script unblocking that loads tags dynamically. On custom code, remove location.reload() from the consent callback.
How can I keep UTM parameters after a redirect?
Make sure the redirect passes the query string along. In nginx use return 301 /new$is_args$args;, and in WordPress redirect plugins enable the option to pass query parameters. Then test with a tagged URL.
Is it allowed to store UTMs and click IDs before consent?
It depends on the region and how the data is stored and used. Many sites treat campaign storage as needing consent or as a defined category in their consent tool. Check with your legal advisor, and never use storage to override a visitor's choice.
Why are my paid conversions showing as direct traffic?
A common cause is lost campaign parameters. If a banner reload, redirect or checkout domain drops utm_* and click IDs, analytics has no source to credit and files the visit as direct. Test with a tagged URL to find where they disappear.
How do I test if my consent banner removes the query string?
Open a private window, load your page with ?utm_source=test&gclid=TEST123, click Accept and watch the address bar. Also check the Network tab for a second page request without the parameters.
Can FunnelGuard tell me if my banner strips UTMs?
Yes. Its UTM persistence check lands on your page with campaign parameters and checks they are still present after the journey, including the banner step. If they are lost, you get an alert with a screenshot and a likely cause.
Related issues
- TRK-282Consent banner shown but tags fire before any choiceFix guide
- TRK-288Consent update never sent after AcceptFix guide
- TRK-304Consent choice not remembered across pagesFix guide
- TRK-305Consent not shared across subdomains / checkout domainFix guide
- TRK-296CMP script fails to load, blocking all tagsFix guide
- TRK-283Tags still fire after visitor rejectsFix guide