On this page
What this issue is
Ad platforms add a click ID to your link when someone clicks an ad. Google adds gclid, Meta adds fbclid. They are long strings of letters, numbers, dashes and underscores, often 60 to 100+ characters. You never type them, so you may never test with them.
Some setups treat that long, random query string as a problem. A security rule may read it as an attack. A rewrite rule may fail to match the URL. A framework route may not expect extra parameters. The page then returns a 404 (not found), 403 (forbidden) or a challenge page, but only for paid visitors.
- Ad clickPlatform appends ?gclid= or ?fbclid=
- Request reaches CDN/WAFRule rejects the query string
- Landing pageNever served; visitor sees 404 or 403
- Form or checkoutNever reached
- Conversion trackingNo tag fires
The ad click is fine. The page request with the click ID is rejected, so every later step is lost.
Why it costs you leads or sales
You pay for the click, and the visitor gets an error. Because the error only appears with click IDs, organic visits, direct visits and your own checks all look fine. The problem can run for weeks without anyone noticing.
It also hurts the numbers. The ad platform sees clicks but no conversions, and bidding algorithms may learn from poor results. Your analytics may show almost no sessions from the campaign, so the traffic looks like a low-quality source when the real fault is on your side.
Example: 1,000 paid clicks where the landing page rejects the click ID, compared with the same clicks after the rule is fixed.
How to check if your site has it
Compare your clean URL with the same URL carrying a realistic click ID. Do it in a private window and also with curl, so browser cache and cookies do not hide the result.
# Clean URL
curl -s -o /dev/null -w "%{http_code}\n" "https://example.com/landing-page/"
# With a Google click ID
curl -s -o /dev/null -w "%{http_code}\n" "https://example.com/landing-page/?gclid=Cj0KCQiA_test1234567890abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJ"
# With a Meta click ID
curl -s -o /dev/null -w "%{http_code}\n" "https://example.com/landing-page/?fbclid=IwAR0test1234567890abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJ"If the clean URL returns 200 and the click ID versions return 404, 403, 406 or 429, you have this issue. Also try a browser user agent, because some rules look at it:
curl -s -o /dev/null -w "%{http_code}\n" -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/120 Safari/537.36" "https://example.com/landing-page/?gclid=test_1234567890abcdefghijklmnopqrstuvwxyz"| Response | Likely cause | Where to look |
|---|---|---|
| 404 only with click ID | Rewrite rule or app route does not allow the query string | .htaccess, nginx config, framework router, CMS redirect plugin |
| 403 or 406 | WAF or ModSecurity rule matched the parameter value | Hosting firewall log, Cloudflare Security Events, Sucuri, Wordfence |
| Challenge or block page | Bot or rate rule triggered by ad traffic | CDN security rules and rate limits |
| 429 | Rate limit hit by bursts of ad clicks | CDN or server rate limiting |
How to fix it
Find the rule that fires
Check the firewall or server log for the blocked request. Look for the rule ID, the matched parameter (gclid or fbclid) and the status code.
Allow the click ID parameters
Add an exception for query parameters named gclid, fbclid, msclkid, ttclid, li_fat_id and utm_* so they are not inspected or rejected. Do not turn the firewall off.
Make routing ignore unknown parameters
Rewrite and redirect rules should match the path only. Make sure the query string is passed through instead of causing a no-match.
Purge caches
Clear CDN and server cache so error responses that were cached for these URLs are not served again.
Retest with real-looking IDs
Run the curl commands again and then click a test ad or a preview link.
Check security plugins
In Wordfence, Sucuri, iThemes or similar, open the firewall or blocked-requests log and look for entries on your landing URL. Allowlist the rule or the parameter.
Check redirect and cache plugins
In redirect plugins (Redirection, Rank Math, Yoast Premium) look for regex rules that match the full URL. In cache plugins, check the 'ignore query strings' list and add gclid and fbclid.
Ask your host about ModSecurity
If the log shows a ModSecurity rule ID, ask the host to whitelist that rule for your domain.
Test a product or page URL
Shopify normally accepts click IDs. If you get a 404, check for a custom app, proxy or theme redirect.
Review URL redirects
Go to Online Store > Navigation > URL Redirects and look for rules matching paths with query strings.
Check any CDN in front
If you put Cloudflare or another proxy in front of a custom domain, apply the Custom code fix there.
Check 301 redirects
Open Site settings > Publishing > 301 redirects and make sure no rule uses patterns that fail with query strings.
Check proxy in front
If Cloudflare sits in front of Webflow, review its WAF and page rules.
Test the live URL
Wix normally handles click IDs. If a page fails only with parameters, check URL Redirect Manager in SEO tools for rules affecting that path.
Contact support with evidence
Send the failing URL and status code if no rule is found.
Fix web server rewrites
Match the path and let the query string pass. In nginx use try_files $uri $uri/ /index.php?$args; and in Apache use QSA on rewrites.
Adjust the WAF
In Cloudflare, check Security > Events for the rule, then create a skip or exception rule for requests with these parameters. In ModSecurity, exclude the ARGS name from the rule that fires.
Fix framework routes
Make sure the router ignores query parameters when matching paths and does not return 404 for unknown ones.
location / {
try_files $uri $uri/ /index.php?$args;
}RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php [QSA,L]How to confirm it's fixed
- curl returns 200 for the URL with a fake gclid
- curl returns 200 for the URL with a fake fbclid
- The page works with both parameters together and with UTMs added
- The final URL in the browser still shows the click ID after load
- The firewall log shows no new blocks for these requests
- The conversion tag fires on the landing page when opened with a click ID
How to prevent it happening again
These faults come back when someone changes security settings, adds a redirect plugin or moves the site behind a new CDN. Build a check into those changes.
- After any WAF, CDN, hosting or redirect change, test landing pages with a fake gclid and fbclid
- Keep a short allowlist note of the parameters your ads use
- Write redirect rules against the path, not the full URL
- Review firewall logs for blocks on landing pages after each campaign launch
- Test every new landing page with click IDs before sending paid traffic
How FunnelGuard handles this
FunnelGuard detects this issue today. Its robot visitor runs a synthetic ad arrival: it opens your landing page the way a paid click would, with a click ID and campaign parameters, and checks that the page loads instead of returning a 404 or a block. Test traffic is marked (utm_source=funnelguard, fg_test=1, an fg_test cookie and its own user agent) and never clicks real ads.
If the arrival fails, FunnelGuard re-checks from a second region, then sends one alert by email, Slack, Teams, WhatsApp, webhook or PagerDuty with a screenshot and a likely cause. It does not bypass CAPTCHAs or bot protection, so if your WAF challenges the marked test visitor, you may need to allow its user agent. The Free plan covers 1 site and 2 journeys with daily checks and no card, and a free read-only website audit is available.
Questions people ask
Why does my landing page show a 404 only when people come from ads?
The ad platform adds a click ID such as gclid or fbclid to the URL. A rewrite rule, router or security rule may not handle that extra query string, so it returns a 404 while the clean URL works. Test both versions with curl to confirm.
Why is my WAF blocking gclid or fbclid?
Click IDs are long random strings, and some WAF rules treat that pattern as suspicious input. Check the firewall log for the rule ID, then add an exception for those parameter names. Keep the rest of the firewall on.
How do I test if fbclid breaks my page?
Open your landing page URL with ?fbclid= and a long made-up value, in a private window or with curl. Compare the status code with the clean URL. A 200 on the clean URL and an error on the other means the click ID is being rejected.
Does Cloudflare block gclid parameters?
Not by default for most sites, but managed rules, custom rules, rate limits or bot settings can block requests that carry them. Look in Security > Events for the rule that fired and create a skip or exception for it.
Should I strip gclid and fbclid from my URLs to fix the error?
No. Stripping them can hide the error but breaks attribution and conversion matching in the ad platforms. Fix the rule that rejects them so the parameters reach the page.
Can a caching plugin cause a 404 with click IDs?
Yes. Some cache or redirect setups mishandle query strings or cache an error for a URL that has parameters. Add gclid and fbclid to the ignored query strings list, purge the cache and retest.
How can I be alerted if ad clicks start failing?
A synthetic check that opens your landing page with a click ID on a schedule will catch it. FunnelGuard runs this kind of ad arrival check and alerts you with a screenshot and a likely cause.
Related issues
- TRK-334Server redirects drop query string (301 to /)Fix guide
- TRK-335Language/geo redirect drops click IDsFix guide
- TRK-323Landing page cache varies on query string, bypassing cache badlyFix guide
- TRK-311UTMs lost on redirect (http->https, www, trailing slash)Fix guide
- TRK-336A/B testing tool redirect drops UTMsFix guide
- TRK-333Shortener/redirect link (bit.ly, Linktree) strips UTMsFix guide