How Cloaking Works: Traffic Signals and Filtering
Follow a single ad click step-by-step to see how a traffic filter checks IP networks, browser headers, and device signals—and why filters sometimes block real buyers by mistake.
- 01 What Happens in the Split Second After an Ad Click
- 02 Step One: Checking the IP Address and Network Provider (ASN)
- 03 Step Two: Checking Browser Headers for Contradictions
- 04 Step Three: Optional Device and Graphics Checks in JavaScript
- 05 Step Four: Showing the Page Without Losing Tracking Tags
- 06 Why Real Mobile Buyers Get Blocked (and How to Fix It)
1. What Happens in the Split Second After an Ad Click
Picture what happens when someone scrolling Instagram or searching on Google taps your ad. Their phone opens a browser window and asks your server for the landing page. Before your server sends back a single image or headline, a traffic filter at the front door has about 20 to 50 milliseconds to answer one question: is this a real customer in my target country, or an automated bot?
To make that decision without slowing down the page, the filter checks the click in four simple steps, going from fastest to most detailed. First, it checks known IP lists. Second, it checks what kind of internet provider the visitor is using. Third, it checks the browser's basic info (device type, language, and ad tracking tags). Fourth, if needed, it runs a tiny check inside the browser itself. As soon as an obvious bot is caught at Step 1 or Step 2, the filter stops immediately so it doesn't waste time.
Why does speed matter so much here? Because on mobile networks, every extra delay adds to TTFB (Time to First Byte—the time the browser waits for the server's very first reply). If your filter calls a slow external server that takes a full second to answer, real customers get tired of staring at a blank screen and close the window before your page ever loads. Always set a short timeout (150–250 ms) on external filter checks so your site stays fast even if the filter server hiccups.
ISP vs. Hosting type & reverse DNS check
JA3/JA4 handshake & browser headers
Serve landing page (200 OK) or block scraper (403)
2. Step One: Checking the IP Address and Network Provider (ASN)
The first thing your server sees is the visitor's IP address. By looking up that IP in a network database, the filter finds its ASN (Autonomous System Number—the official ID number of the internet provider or company that owns that block of IP addresses). Every provider has one: T-Mobile USA is AS21928, Comcast home internet is AS7922, while server hosting companies have their own numbers like Amazon AWS (AS16509) or Hetzner (AS24940).
This single check catches the vast majority of cheap bots and spy tools. Real people shopping for shoes or booking a service connect from mobile carriers or home internet—not from rented virtual servers in a cloud datacenter. Meanwhile, to recognize genuine search and ad platform bots like Googlebot or AdsBot-Google, Google Search Central's verification guide recommends FCrDNS (Forward-Confirmed Reverse DNS—a two-way check that looks up the domain name attached to an IP address and then checks that the domain name points back to that exact same IP) or matching Google's official published IP lists.
One common setup mistake can break IP filtering completely: trusting unverified proxy headers. When you put your site behind Cloudflare or another CDN, your server sees Cloudflare's IP unless it reads the visitor's real IP from a header like CF-Connecting-IP or X-Forwarded-For (RFC 7239). However, if your server is not locked down to accept connections only from Cloudflare, a smart scraper can bypass Cloudflare and send a fake X-Forwarded-For header with a home IP address (for example, 198.51.100.24). Always configure your server firewall so only your trusted CDN can pass visitor IP headers.
3. Step Two: Checking Browser Headers for Contradictions
What if a bot isn't running in a cheap datacenter, or what if it tries to pretend it's an iPhone? That brings us to Step 2: checking the HTTP headers—the short lines of technical info that every browser automatically sends when requesting a webpage (RFC 9110). These include User-Agent (which declares the device and browser model), Accept-Language (the user's language, like en-US or de-DE), and Sec-CH-UA (modern browser identity hints sent by Chrome and Android browsers).
Many basic scraper scripts try to fool filters by copying and pasting an iPhone or Android User-Agent line into a simple Python or cURL program. The catch is that they forget to match the rest of the headers. For instance, the request might claim to be modern Android Chrome (Chrome/124.0), but it fails to send Android's standard Sec-CH-UA-Mobile: ?1 hint or omits the Accept-Language header entirely. Spotting those contradictions lets the filter catch fake browsers immediately.
At the same time, you have to be careful not to punish real mobile apps. When a customer taps your ad inside Facebook, Instagram, or TikTok, the link opens inside a WebView (the app's built-in mini-browser, such as FBAN/FBIOS or BytedanceWebview). On iPhones, Apple's WebView engine never sends Chrome's Sec-CH-UA headers. If you set a rule requiring Chrome headers on all mobile traffic, you will accidentally block every iPhone customer.
| Visitor Environment | What the User-Agent Looks Like | Normal Matching Headers | Red Flag That Reveals a Fake Bot |
|---|---|---|---|
| iPhone Safari / In-App WebView (Meta & TikTok iOS) | CPU iPhone OS ... AppleWebKit/605.1.15 ... Mobile/15E148 | Accept-Language, Accept-Encoding (br, gzip), Sec-Fetch-Dest: document | Claims to be iPhone Safari, but sends Chrome-only Sec-CH-UA headers. |
| Android Chrome / Android In-App WebView | Linux; Android 14; ... Chrome/124.0... Mobile Safari/537.36 | Sec-CH-UA, Sec-CH-UA-Mobile: ?1, Sec-CH-UA-Platform: "Android" | Claims to be modern Android Chrome, but is missing Sec-CH-UA or language headers. |
| Official Meta Link Crawler | facebookexternalhit/1.1 or meta-externalagent/1.1 | Standard crawler headers coming from Meta's official network (AS32934) | Uses Meta's bot name, but connects from a rented VPS hosting company. |
| Simple Script / Scraper Bot | Copied Windows Chrome or iPhone Safari User-Agent | Missing Sec-Fetch-* headers, missing language, or mismatched HTTPS connection | Clear sign of an automated script; safe to block in anti-bot rules. |
4. Step Three: Optional Device and Graphics Checks in JavaScript
Some advanced bots and spy tools route their requests through residential proxies—real home Wi-Fi routers or mobile modems—and use a real browser engine controlled by a computer program. Because the IP belongs to a normal home internet provider and the headers come from a real Chromium engine, network and header checks alone look completely normal.
To spot these automated browsers, filters can run a small JavaScript check inside the visitor's browser to inspect browser fingerprinting (device characteristics like screen touch points, automation flags, and the graphics chip). According to the W3C WebDriver specification, browsers controlled by automation tools like Puppeteer or Playwright set a built-in flag (navigator.webdriver = true). Even if the bot hides that flag, checking the graphics renderer via WebGL often exposes a virtual server: a real phone reports an Apple GPU, Adreno, or Mali chip, whereas a headless server without a graphics card reports a software emulator like Google SwiftShader or Mesa OffScreen.
However, JavaScript checks come with two real drawbacks for media buyers. First, JavaScript can only run after the browser downloads the initial page, which adds a noticeable pause on slow mobile connections. Second, ad platform scanners actively flag heavily scrambled JavaScript that swaps out page content after a delay. For most campaigns, fast server-side network and header checks are much safer and more reliable.
5. Step Four: Showing the Page Without Losing Tracking Tags
Once the filter finishes checking the click, how should it actually display the landing page? In PHP setups, there are three common ways to deliver the page: loading a local file on the same server, fetching content in the background (reverse proxy), or sending a 302 redirect to another URL.
Loading the template locally on the same server (using PHP require) is by far the safest and fastest option. The visitor stays on the exact same URL, the server responds immediately with 200 OK, and every tracking parameter in your link (fbclid, gclid, ttclid, utm_source) stays intact. Reverse-proxy mode pulls the page HTML from another internal server without changing the address bar, though you must make sure images and stylesheets load cleanly.
When setting up a filter such as Cloaking Master, avoid sending cross-domain 302 redirects whenever possible. Jumping across domains slows down mobile loading, triggers 'Destination Mismatch' rejections in Google Ads, and frequently loses the Click ID needed for your conversion postbacks.
- Changes final URL visible in browser address bar
- Breaks Google Ads Parallel Tracking if cross-domain
- Instantly flagged by HTTP redirect-chain auditors
- Keeps your original URL and ad tracking IDs (gclid/fbclid) intact
- Zero extra HTTP round-trip latency (<2ms local I/O)
- Still caught when ad networks compare your page from
- Streams remote offer HTML without changing browser URL
- Adds upstream network RTT (30–120ms) to TTFB
- Requires rewriting relative asset paths and cookies
- Initial HTML looks neutral
- Modern review bots run JavaScript and screenshot the page
- In-app browsers (Instagram/TikTok) notice page swaps and outbound redirects
6. Why Real Mobile Buyers Get Blocked (and How to Fix It)
Every filter rule is a balancing act: make it too loose and scraper bots get in; make it too tight and you start blocking real customers who you already paid the ad platform to reach (false positives). In paid media, blocking 15% of your real mobile buyers hurts your profit far more than letting a few harmless preview bots see your page.
To catch false positives before they drain your budget, compare three numbers every day: clicks billed in your ad cabinet, total clicks recorded in your filter log, and visitors who actually reached your offer page. Some gap is normal because social apps send background preview bots, but if you see lots of blocked clicks inside your target country carrying valid fbclid or gclid tags, check the four common culprits below.
- iPhone Buyers Blocked on Safari: Check whether your filter blocks Cloudflare (
AS13335), Akamai (AS20940), or Fastly (AS54113)—these networks power Apple iCloud Private Relay on iPhones. - Instagram or TikTok Users Blocked on iOS: Make sure your header rules don't demand Chrome-only
Sec-CH-UAheaders, which iPhone in-app browsers (WKWebView) never send. - Mobile LTE Users Blocked During Peak Hours: Check if your IP click-limit rule is blocking a shared mobile carrier IP (CGNAT), where hundreds of phone users share one external IP.
- Ads Rejected for 'Destination Not Working': Check your server logs to confirm official platform bots (
AdsBot-Google,facebookexternalhit) receive a fast200 OKinstead of a firewall block.
- Every ad click goes through a fast 4-step check—known IP lists, network provider (ASN), browser headers, and opt…
- Every millisecond counts on mobile: if your filter takes too long to respond (high TTFB), impatient buyers close…
- Network checks (IP and ASN) reliably catch cheap bots hosted in cloud datacenters, while browser header and Java…
Blocking all IPv6 ranges, penalizing Apple iCloud Private Relay, or rejecting requests without a Referer header …
Frequently Asked Questions (FAQ)
Can a traffic filter spot a human moderator checking my ad from a home internet connection?
No. When a human reviewer clicks your ad from a normal home or mobile internet connection in your target country, their visit looks identical to a real customer. That is why using filters to hide rule-breaking offers is never ban-proof.
Why is it risky to trust the X-Forwarded-For IP header without checking it?
Because any bot can type a fake home IP address into an X-Forwarded-For header before sending a request to your server. Your script should only trust proxy headers when the request comes directly from your own CDN (such as verified Cloudflare IP ranges).
What does 'Google SwiftShader' mean in a browser graphics check?
SwiftShader is a software graphics simulator used by servers that don't have a real graphics card. If a visitor claims to be on an iPhone or Samsung phone, but their browser reports SwiftShader, it is almost certainly an automated headless browser running on a server.
How much delay does a PHP traffic filter add to page loading?
A local PHP check using a database file on your own server takes only 1 to 3 milliseconds. Calling an external cloud filter over the internet usually takes 20 to 120 milliseconds depending on how close your server is to the filter's server.
Related Technical Guides
View Topic Archive →What Is Cloaking in Affiliate Marketing?
Plain-English guide to ad cloaking: what happens when one link shows two different pages, how traffic filtering differs from hiding an offer, and why ad platforms ban deceptive routing.
Traffic Filtering Explained: Edge Defense, Synthetic Case Study, and Policy Compliance
A clear, complete guide to web traffic filtering: how edge firewalls, bot management, and attribution routing work together—plus a step-by-step case study on avoiding costly false positives.
Cloaking vs Bot Protection: What's the Difference?
Compare two actions that look similar under the hood—blocking bots from wasting your ad budget versus showing two different pages to hide an offer—and learn how to keep your firewall from getting your ads rejected.