Skip to main content

Shields

Shields let you exclude specific traffic from your analytics — IP addresses, URL paths, hostnames, and countries. Events matching shield rules are still tracked but excluded from your dashboard and aggregate views.

IP Exclusions

Exclude traffic from specific IP addresses or CIDR ranges. Common uses:

  • Exclude your own traffic while developing or testing
  • Exclude office network IPs
  • Exclude CI/CD servers and automated tools

Adding IP Exclusions

  1. Go to Settings → Shields
  2. Under IP Exclusions, click Add IP
  3. Enter an IP address or CIDR range:
    • Single IP: 203.0.113.42
    • IPv4 range: 203.0.113.0/24
    • IPv6: 2001:db8::1
    • IPv6 range: 2001:db8::/32
  4. Optionally add a label (e.g., "Office network", "My home IP")
  5. Click Save

Finding Your IP

Visit whatismyip.com or run curl ifconfig.me in your terminal.

Path Exclusions

Exclude specific URL paths from tracking. Events on excluded paths are still received but not counted in your dashboard.

Adding Path Exclusions

  1. Under Path Exclusions, click Add Path
  2. Enter a URL path pattern:
    • Exact path: /admin
    • Wildcard: /admin/* (matches /admin/users, /admin/settings, etc.)
    • Multiple patterns: add one per line
  3. Click Save

Common Path Exclusions

  • /admin/* — admin panel pages
  • /staging/* — staging environment paths
  • /internal/* — internal tool pages
  • /preview/* — content preview pages

Hostname Filtering

Restrict tracking to specific hostnames. Only events from allowed hostnames appear in your dashboard. This prevents tracking from unauthorized domains that might have your script installed.

Setting Up Hostname Filtering

  1. Under Hostname Filtering, click Add Hostname
  2. Enter allowed hostnames:
    • example.com
    • www.example.com
    • blog.example.com
  3. Click Save

When hostname filtering is active, events from any hostname not in the list are excluded.

Country Blocking

Exclude traffic from specific countries. Useful for filtering known bot-heavy regions or excluding markets you don't serve.

Adding Country Blocks

  1. Under Country Blocking, click Add Country
  2. Select countries from the dropdown
  3. Click Save

Events from blocked countries are still stored but excluded from your dashboard metrics.

How Shields Work

Shield rules are applied during event processing:

  1. Event arrives at the ingestion pipeline
  2. The event is checked against all active shield rules for the site
  3. Matching events are flagged as excluded
  4. Excluded events are stored but filtered out of dashboard queries and aggregate views

This means:

  • No data is lost — excluded events are still in the database
  • Shields are not retroactive — they only affect events received after the rule is created
  • Multiple shields stack — an event excluded by any rule is excluded from the dashboard

Tips

  • Start with IP exclusions — exclude your team's IPs first to clean up your data
  • Test before deploying — use data-debug on the tracking script to verify which events fire
  • Review periodically — IP addresses change, especially for home networks
  • Use hostname filtering — if you notice traffic from unexpected domains in your sources