Skip to content
FunnelGuard

Fix guide by FunnelsGuard

WAF blocking ad click URLs with long gclid or UTM query: fix

OPS-104High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

A WAF is a filter in front of your site that blocks requests that look like attacks. Ad platforms add tracking parameters to your landing page URL, such as gclid (Google Ads), fbclid (Meta), msclkid (Bing) and utm_* tags. These values are long, random-looking strings. Some WAF rules read that as an attack.

Why it costs you leads or sales

Where the ad click dies
  1. Ad clickURL carries a long gclid and UTMs
  2. WAFQuery string flagged, returns 403
  3. Landing pageNever loads
  4. Form or checkoutNever reached
  5. ConversionNever tracked

The visitor clicks a paid ad, but the firewall stops the request before your site responds.

Paid clicks versus landed sessionsExample numbers
Paid clicks versus landed sessions (example)Clicks paid for: 1,000 clicks; Landed (WAF blocking): 620 clicks; Landed (after fix): 980 clicks03837671,000620980Clicks paid forLanded (WAF blocking)Landed (after fix)clicks

Example: 1,000 paid clicks in a day, where the firewall blocks a share of long-query URLs.

How to check if your site has it

Test your ad URLs
  1. Build a realistic URL

    Take your landing page and add a long fake gclid plus UTMs, e.g. ?gclid= followed by about 100 characters, and utm_source, utm_medium, utm_campaign, utm_content, utm_term.

  2. Request it and read the status

    Use the command below or open the URL in a private window. Anything other than 200 (or an expected redirect) is a warning sign.

  3. Compare with the clean URL

    If the clean URL returns 200 and the long one returns 403, 406, 414 or a challenge, the query string is being filtered.

  4. Check the WAF log

    In Cloudflare see Security > Events; in Sucuri, Wordfence, AWS WAF, or your host panel see the firewall log. Look for the blocked request and the rule ID.

Compare clean and long-query responsesbash
LONG=$(printf 'A%.0s' {1..120})
curl -s -o /dev/null -w "clean: %{http_code}\n" https://example.com/landing/
curl -s -o /dev/null -w "ad url: %{http_code}\n" "https://example.com/landing/?gclid=${LONG}&utm_source=google&utm_medium=cpc&utm_campaign=spring_sale"

How to fix it

Allow ad query strings by platform
  1. Find the blocking plugin or host rule

    Check the firewall log in Wordfence, Sucuri, or your host's WAF. Note the rule ID for the blocked gclid request.

  2. Add a narrow exception

    Allow-list the parameter names gclid, fbclid, msclkid and utm_* for that rule, or ask your host to do it for the ModSecurity rule ID.

Cloudflare custom rule: skip blocking for ad click parameters (example)text
Expression:
(http.request.uri.query contains "gclid=") or (http.request.uri.query contains "fbclid=") or (http.request.uri.query contains "utm_source=")

Action: Skip > select the managed rules or rate limiting rule that is blocking.
Place it above the blocking rule.

How to confirm it's fixed

Confirmation checks
  • The long-query curl test returns 200 (or the same redirect as the clean URL)
  • The WAF log shows no new blocks for gclid or UTM requests
  • The landing page loads in a private window with the long URL
  • Your tags fire on that page and the form still submits
  • Landed sessions in analytics move closer to clicks in the ad platform over the next days

How to prevent it happening again

Try the firewall ruleInteractive
WAF flags long query strings

Rule active

Leads or data lost

Ad click returns 403. The visitor sees an error, and no session or conversion is recorded.

Toggle to see what happens to a paid click with and without the blocking rule.

How FunnelGuard handles this

Questions people ask

Why is my WAF blocking Google Ads clicks?

The gclid parameter is a long, random-looking string, and some WAF rules treat long or encoded query strings as attacks. Check the firewall log for the blocked request and its rule ID, then add a narrow exception for that rule.

Why do I get a 403 error only when I add gclid to my URL?

A rule is reacting to the query string, not the page. Your clean URL passes, but the long gclid or UTM values hit a length limit or pattern match. The WAF event log will show which rule fired.

How do I stop Cloudflare blocking UTM parameters?

Open Security > Events, find the blocked request and see which rule or managed ruleset triggered it. Then add a custom rule with a Skip action for requests whose query contains gclid, fbclid or utm_ parameters, placed above the blocking rule.

Is it safe to allow gclid through my firewall?

Yes, if you keep the exception narrow. Allow known ad parameter names on your landing pages only, and leave other rules active. Do not disable the whole rule set.

What is a 414 error on an ad landing page?

A 414 means the URL was too long for the server or proxy. Raise the limit, such as large_client_header_buffers in nginx or LimitRequestLine in Apache, or shorten the tracking parameters.

How can I tell if ad clicks are being blocked?

Compare clicks in your ad platform with landed sessions in analytics. A big gap, plus a 403 when you test a long ad-style URL, points to a block. The WAF log confirms it.

Will a WAF block affect organic traffic too?

Usually not, because organic URLs have no long tracking query. That is why the problem often only shows in paid reports.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: Synthetic ad arrival.

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.