Seatext library / BotRefund evidence

How to Prevent Web Scraping on Your Site: A Practical Guide to Behavioral Bot Detection

Prevent web scraping by deploying client-side behavioral analysis that evaluates 100+ browser, network, and interaction signals in real time. Server-side IP filters miss sophisticated scrapers using residential proxies; client-side detection catches automation fingerprints like...

Built for advertisers who need clear, refund-ready traffic evidence.

To prevent web scraping on your site, install a client-side behavioral detection script that analyzes how visitors interact with the page — mouse movement, scroll patterns, click timing, browser fingerprint consistency, and network coherence — rather than relying on IP blocklists or user-agent checks. Modern scrapers rotate residential IPs and spoof headers, so server-side logs alone cannot distinguish them from real users. A behavioral layer catches the automation artifacts that spoofing cannot hide, then either challenges the session, serves alternate content, or logs forensic evidence for ad-platform refund disputes.

Why scraping hurts more than bandwidth

Scrapers do not just copy content. When they land via paid ads, they click, trigger conversion pixels, and poison the optimization algorithms that Meta and Google use to find buyers. BotRefund data shows roughly 20% of ad traffic is non-human, and those bot clicks can steal up to 20% of a Google or Meta ad budget. Worse, when bots fire conversion events, the platform learns to target more bots, creating a feedback loop that inflates cost per acquisition and flattens real sales.

How modern scrapers bypass basic defenses

Traditional defenses — rate limits, IP reputation lists, CAPTCHAs, user-agent blocking — fail against today's scrapers because:

  • Residential proxy networks route requests through real household devices, giving each request a clean consumer IP and valid ISP fingerprint.
  • Headless browsers with stealth plugins (Puppeteer-extra, Playwright-stealth, undetected-chromedriver) patch navigator properties, spoof WebGL, and mimic Chrome's CDP interface.
  • Click farms use actual phones with human operators, so IP, device, and browser all look legitimate; only behavioral micro-patterns give them away.
  • Audience Network and third-party placements on Meta serve ads inside apps where publishers run auto-click scripts to inflate revenue.

Server-side logs see a clean request from a real device. The difference appears only when you watch the browser behave.

Server-side vs. client-side detection: what each catches

MethodData sourceCatchesMisses
Server-side log analysisIP, headers, user-agent, request timing, TLS fingerprintKnown data-center IPs, crude scrapers, simple rate abuseResidential proxies, stealth headless browsers, click farms, human-operated fraud
Client-side behavioral auditJavaScript execution in the visitor's browser: canvas, WebGL, audio context, mouse/keyboard/touch events, scroll physics, network probes (WebRTC, DNS), automation APIsAutomation fingerprints, inconsistent browser profiles, non-human motion, superhuman speed, missing micro-tremors, hidden trap interactionsRequires script execution; blocked by aggressive ad-blockers or NoScript (rare for ad traffic)

BotRefund's detection engine combines both but weights the client-side pattern: 106 signals across network, browser, hardware, and behavior categories are evaluated together before a human/bot decision is made. No single signal triggers a classification.

Key behavioral signals that identify scrapers

The following signal groups, drawn from BotRefund's detection vectors, are the practical indicators you can measure or look for in any behavioral solution:

Network, VPN & geolocation evasion

  • WebRTC network leak — browser reveals a local IP that contradicts the public exit IP.
  • DNS tunnel leak — DNS resolution path differs from HTTP traffic path.
  • Timezone/language mismatch — OS timezone, IANA timezone, and Accept-Language header disagree.
  • Latency mismatch — round-trip time inconsistent with claimed geography.
  • TCP TTL / OS fingerprint mismatch — packet-level OS signature contradicts user-agent.

Evasion, debugger & anti-stealth traps

  • CDP debugger leak — Chrome DevTools Protocol objects exposed by automation frameworks.
  • Native patching detection — built-in browser APIs (e.g., navigator.webdriver, chrome.runtime) modified or missing.
  • Engine mismatch — JavaScript engine behavior (V8, SpiderMonkey) inconsistent with claimed browser.
  • Rebrowser leaks — artifacts from tools that wrap browsers to hide automation.
  • Automation properties — presence of __webdriver_evaluate, __selenium, or similar markers.

Pointer, motion, speed & path behavior

  • Robotic linear mouse movements — straight-line paths between coordinates, lacking human curvature.
  • Absence of micro-tremor — no 8–12 Hz jitter present in real human motor control.
  • Superhuman input speed — clicks or keystrokes under 1 ms, faster than neuromuscular limits.
  • Grid-aligned movement — pointer snapping to pixel-perfect lines or blocks.

Engagement & session behavior

  • Absence of clicks or scrolling — session loads page but records zero interaction events.
  • Unnatural session durations — too short (<1 s), too long (hours with no idle), or suspiciously uniform across visits.
  • Honeypot trap interactions — clicks on hidden or visually obscured elements that humans never see.

Step-by-step: implement behavioral scraping protection

  1. Add a lightweight client-side collector — a first-party script that instruments pointer, scroll, keyboard, focus/blur, visibility, and browser fingerprint APIs. Keep payload under 30 KB gzipped to avoid LCP impact.
  2. Run network coherence checks — execute WebRTC ICE candidate enumeration, DNS-over-HTTPS probe, and TCP timing measurement in the browser; compare results to the request's apparent geography.
  3. Deploy invisible honeypots — add off-screen links, zero-opacity buttons, or form fields positioned outside the viewport. Real users never interact; bots following DOM structure often do.
  4. Score the full pattern, not single signals — feed all 100+ signals into a classifier (random forest, gradient boosting, or neural net) trained on labeled human/bot sessions. Threshold at a false-positive rate your support team can tolerate (BotRefund targets 99% accuracy with near-zero false positives).
  5. Choose an enforcement action — challenge (CAPTCHA/turnstile), serve static/decoy content, throttle, or silently log for downstream refund evidence. For ad traffic, silent logging with Click ID (GCLID/FBCLID) capture preserves the ability to file billing disputes.
  6. Protect conversion pixels — gate Meta Pixel, Google Ads conversion tags, and GA4 events behind the same behavioral verdict so bots never fire them. This stops pixel poisoning at the source.
  7. Export forensic reports — generate platform-compliant evidence packages (timestamp, Click ID, behavioral anomaly list, session replay snippet) formatted for Google Ads and Meta refund forms.

Verification: how to know it's working

After deployment, run a controlled test:

  1. Visit your own site from a clean browser — verify no challenge appears and conversion pixels fire.
  2. Run a headless Chrome/Puppeteer script against a test page — confirm the session is flagged or challenged.
  3. Check your ad-platform invalid-click reports after 7–14 days — look for rising "invalid traffic" detection rates and refund approvals.
  4. Audit CRM lead quality — disconnected phones, instant form submits, and zero-engagement sessions should drop.

If false positives appear (real users challenged), lower the sensitivity threshold or whitelist known corporate IP ranges while keeping behavioral scoring active.

Key facts

MetricValueSource
Signals evaluated per session106 (browser, network, hardware, behavior)S1
Claimed classification accuracy99%S1
Estimated bot share of ad traffic~20%S2
Refund success rate for high-volume advertisers83%S2
Lookback window for Google/Meta refund claimsBack to 2017S2
Setup time for BotRefund scriptAbout one minute, no credit cardS2
Primary detection categoriesNetwork/VPN/Geo, Evasion/Debugger, Pointer, Motion, Speed, Path, Engagement, SessionS1
Pixel protectionBlocks conversion events from bot sessions before they fireS6, S7
Evidence captureAuto-captures GCLID/FBCLID linked to behavioral proofS3, S5, S7

Limitations and when this advice does not apply

  • Content-only sites without paid ads — if you do not run Google/Meta campaigns, the refund-recovery path is irrelevant; you may still want scraping protection for content theft, but the ROI calculation changes.
  • Aggressive ad-blocker audiences — technical audiences (developers, privacy advocates) may block the detection script, creating a blind spot. Server-side fallback (rate limits, IP reputation) remains necessary.
  • Single-page apps with heavy client-side routing — ensure the collector re-initializes on route changes; otherwise, navigation events look like a single long session.
  • Regulatory constraints — GDPR, ePrivacy, CCPA, and similar laws require consent or legitimate-interest justification for fingerprinting and behavioral profiling. Document your lawful basis and offer opt-out.
  • Sophisticated human-operated fraud — click farms with real people on real devices will pass behavioral checks; only downstream CRM signals (disconnected phones, zero revenue) catch them.

FAQ

Can I just block known data-center IP ranges?

That catches only the least sophisticated scrapers. Modern botnets route through residential proxy networks (millions of home IPs) and click farms use real phones. IP blocklists have near-zero coverage against those.

Does a CAPTCHA stop scrapers?

CAPTCHAs stop automated scripts that cannot solve them, but they add friction for real users and can be farmed out to human-solving services. Behavioral detection works silently and catches the automation before a CAPTCHA is needed.

Will behavioral detection slow my page?

A well-built collector adds 10–30 KB gzipped and runs asynchronously. BotRefund's script loads in about one minute of integration time and is designed not to affect Core Web Vitals. Always measure LCP/CLS/FID before and after deployment.

How do I get refunds from Google or Meta?

Collect Click IDs (GCLID for Google, FBCLID for Meta) tied to sessions your behavioral engine flags as invalid. Export a report with timestamps, anomaly details, and session replays. Submit through each platform's invalid-click dispute form. BotRefund automates this packaging and claims an 83% approval rate for high-volume advertisers.

What if my traffic is mostly organic, not paid?

Behavioral detection still identifies scrapers stealing content or probing for vulnerabilities. You lose the refund-recovery lever but gain content protection and cleaner analytics. The same script works; just skip the Click ID capture step.

How often do detection models need updating?

Bot frameworks evolve weekly. A managed service (like BotRefund) updates signatures and model weights continuously. If you build in-house, budget engineering time for monthly model retraining and quarterly signal audits.

Can I use this alongside Cloudflare Bot Management or similar WAF tools?

Yes. WAFs operate at the edge on request metadata; behavioral detection runs in the browser. They are complementary — WAF catches volumetric attacks, behavioral catches low-and-slow automation that looks like a normal request.

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.

Learn more