Seatext library / BotRefund evidence
Best Practices for Implementing Puppeteer Detection: A Multi-Signal Approach
Effective Puppeteer detection requires combining multiple detection vectors — client-side JavaScript signals, network-level checks, and behavioral analysis — rather than relying on any single indicator. BotRefund's approach evaluates 106 browser, network, hardware, and behavior...
✓ Built for advertisers who need clear, refund-ready traffic evidence.
Detecting Puppeteer and other headless browser automation is not about finding one magic signal. Modern automation tools deliberately spoof user-agent strings, hide the navigator.webdriver flag, and mimic human-like mouse movements. The most reliable approach layers multiple independent checks: client-side JavaScript property analysis, Chrome DevTools Protocol (CDP) leak tests, network fingerprinting, and behavioral pattern recognition. When these signals are evaluated together, they create a fingerprint that is far harder to forge than any single property.
Why Puppeteer Detection Matters
Automated browsers power click fraud, content scraping, credential stuffing, and ad fraud at scale. When bots click your ads, they drain budget without converting. When they scrape your content, they steal intellectual property. When they poison your conversion pixels, they corrupt the machine-learning models that optimize your campaigns. Detecting this traffic early protects revenue, preserves data integrity, and gives you the evidence needed to claim refunds from ad platforms.
Ignoring detection or relying on basic filters means you pay for fake engagement. Meta and Google both offer refund processes for invalid traffic, but they require forensic evidence — client-side behavioral logs, click IDs tied to session data, and proof that the interaction was non-human. Without a detection system that captures this evidence in real time, you cannot recover wasted spend.
How Puppeteer Detection Works: Core Detection Vectors
Puppeteer detection falls into three categories that must work in concert:
- Client-side JavaScript signals — properties exposed in the browser runtime that differ between automated and genuine sessions.
- Network and transport signals — inconsistencies in TLS fingerprints, WebRTC leaks, DNS routing, and TCP/IP stack behavior.
- Behavioral signals — interaction patterns (mouse movement, scroll depth, timing) that are statistically improbable for humans.
No single category is sufficient. A sophisticated bot can pass JavaScript checks but fail on network fingerprinting. A residential proxy botnet may pass network checks but reveal itself through superhuman input speed or missing micro-tremors in mouse movement. The defense-in-depth principle applies: each layer catches what the others miss.
Client-Side Detection Signals
The browser runtime exposes dozens of properties that automation tools struggle to replicate perfectly. BotRefund's detection engine monitors signals across several families:
Automation and Debugger Leaks
- CDP Debugger Leak — Checks for traces left by the Chrome DevTools Protocol, which Puppeteer uses to control the browser.
- Automation Properties — Detects non-standard properties injected by automation frameworks.
- Rebrowser Leaks — Identifies artifacts from tools that attempt to mask automation.
Engine and Runtime Consistency
- Engine Mismatch — Verifies the JavaScript engine behaves like a genuine Chrome build.
- JS Engine Mismatch — Cross-checks V8 internals against known-good baselines.
- Native Patching — Detects when native browser APIs have been monkey-patched to hide automation.
Network, VPN, and Geolocation Evasion
- WebRTC Network Leak — Reveals the true local IP address even when a proxy is used.
- DNS Tunnel Leak and DNS Challenge Blocked — Confirm DNS and HTTP traffic follow the same path.
- DNS Routing Mismatch — Flags discrepancies between DNS resolution and connection routing.
- IP Address Inconsistency — Correlates the apparent IP with network-layer signals.
- OS / TCP TTL Mismatch — Checks TCP stack fingerprints against the claimed operating system.
- Suspicious Ports — Identifies non-standard port usage typical of proxy tunnels.
- Latency Mismatch — Compares connection latency with claimed geography.
Locale and Environment Consistency
- Timezone Evasion and UTC Timezone Bias — Verify the system clock matches the claimed locale.
- Languages Mismatch and Accept-Language Mismatch — Cross-check navigator languages with HTTP headers.
- HTTP User-Agent Mismatch and HTTP Protocol Mismatch — Validate that headers match the browser's actual capabilities.
- Netprobe Telemetry Missing — Flags absence of expected browser telemetry.
These 21 signals represent a subset of the 106 total vectors BotRefund evaluates. The key insight is that signals become a decision only when seen together — a single anomaly may be a false positive, but a cluster of correlated anomalies across network, engine, and behavior dimensions is strong evidence of automation.
Server-Side Validation and Network Analysis
Client-side checks run in the visitor's browser and can be tampered with. Server-side validation provides a second, independent vantage point:
- TLS/JA3 fingerprinting — The TLS handshake reveals the client's crypto library and version. Puppeteer's default stack often differs from standard Chrome.
- HTTP/2 and HTTP/3 settings — Header ordering, window sizes, and prioritization trees vary between real browsers and automation tools.
- IP reputation and ASN analysis — Data center, hosting, and known proxy ranges correlate with automated traffic.
- Request timing and sequencing — Automated scripts often fire requests in rigid patterns or with implausible concurrency.
Correlating server-side observations with client-side telemetry closes the loop: if the client claims a residential Chrome on Windows but the TLS fingerprint matches a Linux data center build, the session is flagged.
Behavioral Analysis Patterns
Even when a bot passes technical fingerprinting, its behavior often betrays it. BotRefund tracks several behavioral dimensions:
- Pointer behavior — Robotic linear mouse movements, grid-aligned movement patterns, and absence of humanlike micro-tremor.
- Speed behavior — Superhuman input speed (sub-millisecond clicks), impossibly fast form completion.
- Path behavior — Movement that snaps to precise coordinates instead of natural curves.
- Engagement behavior — Absence of clicks, scrolling, or meaningful dwell time.
- Session behavior — Unnatural session durations (too short, too long, or too uniform across sessions).
- Trap behavior — Interaction with honeypot elements invisible to humans but present in the DOM.
- Ghost click detection — Click activity without the natural sequence of human intent (hover, pause, click).
These patterns are evaluated statistically across populations, not as hard thresholds. A single fast click is noise; a session where every interaction is sub-millisecond is signal.
Implementation Process: Step-by-Step
- Instrument the client — Deploy a lightweight JavaScript collector that gathers the 106 signals without blocking page load. The script should run early, capture the full signal set, and send a compact payload to your analysis endpoint.
- Establish baselines — Collect traffic for 7–14 days without enforcement. Label known human traffic (logged-in users, converted sessions) and known bot traffic (monitoring endpoints, test automation). Train or calibrate your scoring model on this labeled set.
- Define decision thresholds — Set score bands: definitely human (pass), definitely bot (block/challenge), uncertain (challenge with CAPTCHA or proof-of-work). Avoid binary allow/deny; use graduated responses.
- Integrate server-side correlation — Join client payloads with server logs on session ID. Compare TLS fingerprint, IP ASN, and request patterns against client-declared environment.
- Capture refund evidence — For ad traffic, store the click ID (GCLID, FBCLID, MSCLKID) alongside the full behavioral log. This evidence package is what ad platforms require for refund claims.
- Enable real-time feedback — Feed detection decisions back to the client within the same session (e.g., suppress conversion pixels for flagged sessions) to prevent pixel poisoning.
- Monitor and retrain — Track false positive/negative rates weekly. Update signal weights and baselines as browser versions change and new evasion techniques appear.
Common Mistakes and Limitations
| Mistake | Why It Fails | Better Approach |
|---|---|---|
Relying only on navigator.webdriver | Trivial to spoof; Puppeteer Stealth and similar plugins hide it by default. | Treat it as one weak signal among many; require corroboration. |
| Blocking on user-agent string alone | User-agent is fully controllable by the client. | Validate UA against JS engine, TLS fingerprint, and hardware concurrency. |
| Using static IP blocklists | Residential proxy botnets rotate through millions of clean IPs. | Combine IP reputation with behavioral and fingerprint signals. |
| No server-side validation | Client-side checks can be disabled or spoofed in the browser. | Always correlate client telemetry with independent server observations. |
| Treating all automation as hostile | Legitimate uses: testing, accessibility tools, archiving, SEO crawlers. | Allowlist known-good bots by verified identity (e.g., Googlebot via reverse DNS). |
| No evidence capture for refunds | Ad platforms reject claims without click-ID-linked behavioral proof. | Store GCLID/FBCLID + full session log for every paid click. |
Limitations: Detection is a moving target. New Puppeteer versions, stealth plugins, and residential proxy networks constantly evolve. No system achieves 100% accuracy; the goal is to raise the attacker's cost above the value of the target. Privacy regulations (GDPR, CCPA, ePrivacy) constrain what data you can collect and how long you can retain it. Always implement data minimization, purpose limitation, and user consent flows where required.
Key Facts
| Signal Category | Example Signals (from BotRefund's 106-vector set) | What It Detects |
|---|---|---|
| Automation & Debugger Leaks | CDP Debugger Leak, Automation Properties, Rebrowser Leaks | Traces of Chrome DevTools Protocol control, injected automation properties, masking-tool artifacts |
| Engine & Runtime Consistency | Engine Mismatch, JS Engine Mismatch, Native Patching | V8 engine anomalies, monkey-patched native APIs |
| Network, VPN & Geolocation | WebRTC Network Leak, DNS Tunnel Leak, IP Address Inconsistency, OS/TCP TTL Mismatch, Latency Mismatch | Proxy/VPN use, geography spoofing, TCP stack fingerprint mismatches |
| Locale & Environment | Timezone Evasion, Languages Mismatch, HTTP User-Agent Mismatch, Netprobe Telemetry Missing | System locale vs. claimed locale, header vs. runtime inconsistencies |
| Behavioral | Pointer behavior (linear/grid/tremor), Speed behavior (sub-ms), Path behavior, Engagement (no scroll/click), Session duration anomalies, Trap interaction, Ghost clicks | Non-human interaction patterns, automated navigation, honeypot triggers |
FAQ
How often should I update my detection rules?
At minimum, review signal weights and baselines monthly. Browser updates (Chrome releases every 4 weeks) can shift legitimate fingerprints. Evasion tools update faster. Automate retraining pipelines where possible.
Can I detect Puppeteer without JavaScript on the client?
Server-only detection (TLS fingerprinting, IP reputation, request patterns) catches some bots but misses sophisticated automation that uses real browser binaries. Client-side telemetry is essential for high accuracy.
What is the false positive rate for multi-signal detection?
With 106 correlated signals and a calibrated model, BotRefund reports 99% accuracy. Single-signal approaches typically see 5–20% false positives. The trade-off is implementation complexity.
Do I need to block detected bots immediately?
Not always. For ad traffic, the priority is capturing evidence (click ID + behavioral log) for refund claims. Blocking can be gradual: challenge uncertain traffic, suppress conversion pixels for flagged sessions, block only high-confidence bots.
How does detection integrate with Google Ads and Meta refund processes?
Both platforms require click identifiers (GCLID, FBCLID) linked to behavioral evidence showing invalid interaction. Your detection system must capture these IDs at click time and export compliance-ready reports.
Is Puppeteer detection different from general bot detection?
Puppeteer is one automation framework. A robust bot detection system targets the class of headless/automated browsers (Puppeteer, Playwright, Selenium, custom CDP clients) rather than one tool. The signals overlap heavily.
What resources are needed to maintain a detection system?
Engineering time for collector maintenance, model retraining, and rule updates. Expect 0.5–1 FTE for a mid-volume site. Managed services (like BotRefund) reduce this to integration effort only.
Further reading and comparison sources
These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.
Learn more
Visit the website for more information.