Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Consent banner reload strips UTMs and click IDs: how to fix it

TRK-295High impactDetectedBy FunnelGuardPublished Updated
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.

Where the attribution is lost
  1. Ad clickURL carries utm_* and gclid
  2. Banner AcceptPage reloads without the query string
  3. Tags loadNo source or click ID to read
  4. ConversionReported as direct or unassigned

The visitor converts normally, but the data that ties the sale to the ad is dropped at the banner.

Paid conversions credited to the right campaignExample numbers
Paid conversions credited to the right campaign (example)Reload keeps parameters: 92 conversions; Reload strips parameters: 41 conversions035719241Reload keeps paramete…Reload strips paramet…conversions

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

Test it by hand in five minutes
  1. 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.

  2. Visit a tagged URL

    Load your landing page with ?utm_source=test&utm_medium=cpc&utm_campaign=banner-check&gclid=TEST123 added.

  3. 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.

  4. 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.

  5. Inspect the first tag hit

    Filter for collect (GA4) or the Google Ads request. Check whether dl (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.

Fix by platform
  1. 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.

  2. Check URL-rewriting plugins

    Look at redirect, cache and multilingual plugins for rules that strip query strings, and make sure they pass them through.

  3. Add the capture script

    Add the snippet below in the header with a code-snippet plugin or your child theme.

Save UTMs and click IDs on landingjavascript
(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));
  }
})();
Redirect that keeps the query stringnginx
# $is_args$args keeps ?utm_source=... on the redirect
location = /old-offer {
  return 301 /offer$is_args$args;
}
Accepting the banner

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
Banner reload and your campaign dataInteractive
Banner reloads the page on Accept

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

Fix verification
  • 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.

Keep it fixed
  • 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.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: utm persistence.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.