uTPro.Feature.AdProtect
18.0.1
dotnet add package uTPro.Feature.AdProtect --version 18.0.1
NuGet\Install-Package uTPro.Feature.AdProtect -Version 18.0.1
<PackageReference Include="uTPro.Feature.AdProtect" Version="18.0.1" />
<PackageVersion Include="uTPro.Feature.AdProtect" Version="18.0.1" />
<PackageReference Include="uTPro.Feature.AdProtect" />
paket add uTPro.Feature.AdProtect --version 18.0.1
#r "nuget: uTPro.Feature.AdProtect, 18.0.1"
#:package uTPro.Feature.AdProtect@18.0.1
#addin nuget:?package=uTPro.Feature.AdProtect&version=18.0.1
#tool nuget:?package=uTPro.Feature.AdProtect&version=18.0.1
uTPro AdProtect for Umbraco
Invalid-click protection and ad-serving control for Umbraco sites monetized with Google AdSense (or any ad network). Think "Ad Invalid Click Protector" (AICP) for WordPress — rebuilt native for Umbraco/.NET, cache-safe and multi-site aware.
Works with Umbraco 17 and 18.
Documentation: https://docs.utpro.dev/uTPro.Feature.AdProtect/
Why
AdSense accounts get "ad serving limits" for invalid traffic — bots, scanners and a handful of accidental or abusive clicks. On small sites a few anomalous clicks are enough to trigger a limit, and repeated flags risk account termination.
AdProtect decides per visitor, per request whether ad code should be served at all, and logs ad-click intent so repeat clickers stop seeing ads.
Features
- Visitor gate — hide ads for:
- blocked IPs / CIDR ranges (manual list + bulk import)
- blocked countries (reuses
uTPro.Feature.GeoLocation) - datacenter/hosting ASNs (built-in list, disabled by default — enable with one click)
- visitors who exceeded the click budget (auto cool-down, durable across restarts)
- Click-intent tracker — lightweight vanilla JS (~2 KB, no jQuery) using the
mouseenter+window blur/visibilitychangeheuristic on the ad container; click events are HMAC-token bound, de-duplicated and never accepted from client-supplied IPs - Cache-safe by design — the Razor tag renders an empty slot; a tiny fetch to
/api/adprotect/checkdecides whether the ad script loads. Works with output cache, works on any host (including static front-ends pointing at the API) - Backoffice workspace (under Settings) — dashboard (serves / blocks / top IPs / 14-day trend), rules CRUD, active blocks with manual unban, click log, live settings — no restart needed
- CGNAT-aware — budgets counted per anonymous cookie and per IP, so mobile users behind carrier-grade NAT (common in VN) are not collateral damage
- Privacy option — store IPs as keyed hashes (HMAC-SHA256), still matchable
Install
dotnet add package uTPro.Feature.AdProtect
The package self-wires: the database tables are created on first boot, the
Settings → AdProtect workspace appears in the backoffice, and the gate
endpoints register themselves — no Program.cs changes.
Show an ad slot
Register the tag helper in Views/_ViewImports.cshtml:
@addTagHelper *, uTPro.Feature.AdProtect
Replace your ad markup with:
<utc-ad slot="banner-top" render-ins />
Set your AdSense client id in Settings → AdProtect → Settings (or per slot with
client-id="ca-pub-..."). Keep your existing adsbygoogle.js script tag in the page
head — AdProtect only pushes to adsbygoogle after the gate allows the visitor.
Requires uTPro.Feature.GeoLocation (installed automatically) for client-IP and
country resolution.
Links
- Documentation: https://docs.utpro.dev/uTPro.Feature.AdProtect/
- Issue tracker: https://github.com/T4VN/uTPro.Feature.AdProtect/issues
© uTPro. Free (proprietary) license — same as other uTPro feature packages.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Umbraco.Cms.Api.Management (>= 18.0.0 && < 19.0.0)
- uTPro.Feature.GeoLocation (>= 18.0.0 && < 19.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v17.0.1 / v18.0.1: Package title cleanup - the NuGet package title no longer carries the "for Umbraco N" suffix, so the marketplace listing shows the plain product name. No functional, API, UI or database changes. v17.0.0 / v18.0.0: Initial release. Ships as two version lines — 17.x for Umbraco 17 and 18.x for Umbraco 18 — with each line's Umbraco dependency boxed to that one major, so an Umbraco 17 host always resolves the 17.x line. Visitor gate (IP/CIDR/country/ASN rules + datacenter-ASN seed), click-intent tracker with HMAC-token binding and de-duplication, per-IP/per-cookie click budget with auto cool-down, cache-safe check endpoint, utc-ad TagHelper + vanilla JS, backoffice workspace under Settings (dashboard, rules, blocks, click log, live settings), optional HMAC-hashed IP storage. Requires uTPro.Feature.GeoLocation.