RumRule
Source:
src/Cloudflare/Rum/Rule.ts
A Cloudflare Web Analytics (RUM) rule.
Rules include or exclude traffic from Web Analytics measurement by
hostname and path patterns. They live under the implicit ruleset of a
zone-based (orange-clouded) RumSite — pass the site’s rulesetId
attribute. Host, paths, inclusive, and isPaused are all mutable in
place; changing rulesetId triggers a replacement.
Web Analytics is available on free accounts.
Excluding traffic
Section titled “Excluding traffic”const zone = yield* Cloudflare.Zone("Zone", { name: "example.com" });
const site = yield* Cloudflare.RumSite("Analytics", { zoneTag: zone.zoneId, autoInstall: true,});
yield* Cloudflare.RumRule("ExcludeAdmin", { rulesetId: site.rulesetId.as<string>(), host: "example.com", paths: ["/admin/*"], inclusive: false,});Pausing a rule
Section titled “Pausing a rule”yield* Cloudflare.RumRule("ExcludeAdmin", { rulesetId: site.rulesetId.as<string>(), host: "example.com", paths: ["/admin/*"], inclusive: false, isPaused: true,});