← Docs Docs

Protection Modes: Measure vs Block-Before-Serve

PubSentry has exactly two protection modes per site: Measure and Block. They answer one question — when the engine decides a visitor is invalid, does PubSentry suppress the ad, or just record the decision? Block is the product's core mechanic (block-before-serve). Measure is the on-ramp: watch verdicts accumulate against your real traffic before you let PubSentry act.

This page explains both modes precisely, the separate Safety Mode dial that controls how strict scoring is, and exactly how the tag enforces them on the page.

The two modes

A site's protection mode is one of two values (measure or block). You set it in the dashboard; the tag reads it and honors it client-side. The default for a new site is Block — there is no separate "trial" or "audit" period baked in; you opt into Measure if you want one.

Block (the default) — block-before-serve

In Block mode, when the gate is holding a definite block verdict, PubSentry suppresses the ad before the impression fires. This is the whole point of the product: an invalid visitor never generates an impression or a click that could put your AdSense or ad-network account at risk.

The tag enforces this across your ad stack — Google Publisher Tag (Ad Manager), AdSense / Auto Ads, Amazon apstag, and Prebid, plus a universal MutationObserver fallback for networks without a dedicated hook. Suppression happens at the slot level, before the ad request goes out. Valid traffic is untouched: ads serve normally.

Measure — observe only, suppress nothing

In Measure mode, the engine scores every visitor and beacons every pageview exactly as it does in Block — but the gate never suppresses an ad. You see the full set of verdicts (allow / monitor / block), the reasons behind each one, and the would-be revenue impact in the dashboard, while every ad serves.

Measure is the honest way to build confidence. Run it for a few days, watch what PubSentry would have blocked, confirm the blocks are all genuinely invalid traffic and nothing that looks like a real reader, then flip to Block. Because the first principle is FPR = 0 (never block a real human), Measure exists so you can verify that promise against your own audience before enforcement is live.

The internal toggle is simple: enforcement is on (enforce=true) in Block and off in Measure. With enforcement off, the gate still records the verdict for the beacon, but the ad always serves.

How the tag honors the mode

The mode lives server-side (in Redis) and is exposed to the tag over a public, cached endpoint — /v1/site-config?site=st_xxxx — which returns your mode and safety_mode. The behavior is built so the very first gate decision on the page is correct, not a guess that gets corrected late:

  1. On boot, the tag reads a cached copy of the config synchronously, so the first ad-slot decision already respects Measure mode and your Safety Mode without waiting on the network.
  2. It then refreshes the config asynchronously. Switching to Measure releases suppression immediately; a changed Safety Mode applies on the next pageview.

Everything is fail-open. If the config fetch fails, the tag falls back to safe defaults and — as always — any error resolves to serve the ad. The gate suppresses a slot only when it is actively enforcing and holding a definite block. A false positive is the worst outcome, so when in doubt, the ad serves.

Nothing about the mode changes the install. It's the same single async tag either way:

<script async src="https://pubsentry.com/t.js" data-site="st_xxxx"></script>

You switch between Measure and Block in the dashboard, not in the snippet.

Mode vs Safety Mode — two different dials

These are independent and often confused. Keep them separate:

  • Protection Mode (measure / block) — does PubSentry act? Measure observes; Block enforces.
  • Safety Mode (conservative / balanced / aggressive) — how strict is scoring? It moves the score thresholds at which a visitor is monitored or blocked. The default is balanced.

Safety Mode is the false-positive/catch-rate dial. Conservative blocks only the most certain invalid traffic (highest score bar); aggressive lowers the bar to catch more. It applies on both paths: the tag uses it in the local gate, and the ingest server uses it when it re-scores the beacon server-side. Because FPR = 0 is the product's top principle, the defaults are deliberately conservative priors — they earn their strictness on real, labeled traffic over time rather than blocking aggressively out of the gate.

A useful way to hold it: Protection Mode decides whether the verdict is enforced; Safety Mode decides what the verdict is. You can run aggressive scoring in Measure to see how much extra it would catch, without suppressing a single ad.

What each mode does to the data

Both modes produce identical telemetry — the same beacon, the same enriched event (geo / ASN / datacenter from the IP, device from the User-Agent), the same scored verdict with its reasons. As always, the tag never sends raw IP or User-Agent; the server derives what it needs, hashes the raw values with HMAC-SHA256, and drops them. The only difference between Measure and Block is whether the gate acts on a block verdict.

In Measure you read those screens as "here is what we would have stopped"; in Block you read them as "here is what we stopped."

  1. Install the tag and confirm the first beacon lands on the Install screen.
  2. Start in Measure if you want a verification window. Let real traffic flow for a few days.
  3. Review the would-be blocks in Live Feed and Invalid Traffic. Confirm they are genuinely invalid and that nothing resembling a real reader is being flagged.
  4. Flip to Block. Suppression is live from the next gate decision; switching back to Measure releases it immediately if you ever need to.
  5. Tune Safety Mode only if you have a reason to — balanced is the right default for almost everyone.

Most publishers can install in Block from day one and be safe, because Block still serves the ad on any uncertainty. Measure simply lets the cautious confirm FPR = 0 first.

A note on honesty

PubSentry catches obvious and general invalid traffic (GIVT) at near-100% recall with zero false positives. Sophisticated mimicry — residential-IP bots with no tells — is only partially caught today, and that gap closes as the cross-site reputation network and the ML moat grow on real traffic. We never claim 100%, in any mode. Block mode enforces what the engine is confident is invalid; it does not pretend to stop what it cannot yet see. See the Security page for how we scope this.

Programmatic control (coming)

Today you set protection mode and safety mode in the dashboard. The /v1/* endpoints behind the UI are session-scoped to your account and are not a documented public integration — they can change. A stable, documented public API and outbound webhooks are on the roadmap (coming), not shipped. If you need to script mode changes across many sites now, tell us what you're building so we can scope it honestly rather than point you at endpoints that may move.

Stop invalid traffic before the ad fires. Score every visitor, block the invalid ones pre-serve, protect your account. Free for your first 500 pageviews.
Start free →