Skip to content
Features

Traffic Filtering

Block unwanted traffic by IP address or country to keep your analytics clean.

Overview

Traffic filtering allows you to exclude certain visitors from your analytics data. This is essential for:

  • Excluding your own visits while developing or testing
  • Filtering out known bot traffic (on by default)
  • Blocking traffic from specific countries
  • Ignoring hits from domains you don't own (see Included / Excluded Domains in site settings)
  • Excluding office or team IP addresses

Excluding your own visits

Invoker counts your own visits like anyone else's, even while you're signed in to the dashboard. Pick one:

  • Block your IP address (below). Works for every browser and device on that network, and is the best option for an office.
  • Opt out a single browser: open your site, then run window.invoker.blockTrackingForMe() in the developer console. It stores a flag in that site's localStorage; window.invoker.enableTrackingForMe() undoes it. Clearing site data removes it.
  • Skip development and staging: add localhost or staging.example.com to Excluded Domains in site settings.

Allowed (included) and excluded domains

Anyone can copy your snippet onto another website. To only accept data from hostnames you own, list them under Site → Settings → Included Domains. When the list is empty, every hostname is accepted.

  • Matches are exact: example.com and www.example.com are different entries.
  • *.example.com matches any subdomain but not example.com itself — add both if needed.
  • Excluded Domains always win over included ones.
  • The script has matching data-included-domains / data-excluded-domains attributes (exact hostnames only) if you'd rather stop hits in the browser.

Do Not Track

To skip visitors whose browser sends Do Not Track, turn on Respect Do Not Track in Site → Settings → Privacy & Tracking (the server drops those hits), and/or add data-honor-dnt="true" to the script (nothing is sent at all). Both are off by default. See Privacy & GDPR.

Bots

Known bots, crawlers and headless browsers are detected from the user agent and dropped. This is on by default.

IP Blocking

Block specific IP addresses or ranges from being tracked.

Supported Formats

FormatExampleDescription
Exact IP192.168.1.100Blocks a single IP address
CIDR Range192.168.1.0/24Blocks all IPs in a subnet
Wildcard192.168.*.*Blocks matching pattern
IPv62001:db8::1Exact IPv6 addresses (CIDR ranges and wildcards are IPv4 only)

Adding Blocked IPs

  1. Go to your site's Settings page
  2. Find the "IP Blocking" section
  3. Enter an IP address or range
  4. Click the add (+) button
  5. Save your settings
Common IP Blocking Scenarios
# Block your home IP
98.234.56.78

# Block your office network
10.0.0.0/8

# Block a range of IPs
203.0.113.0/24

# Block with wildcards
192.168.1.*

Finding Your IP Address

To find your current IP address:

  1. Search "what is my IP" in any search engine
  2. Or use a service like ifconfig.me
  3. Note: Your IP may change if you don't have a static IP

Country Blocking

Block all traffic from specific countries using ISO country codes.

How It Works

When country blocking is enabled:

  1. We determine the visitor's country using IP geolocation
  2. If the country matches a blocked code, the pageview is not recorded
  3. The visitor still sees your website normally

Adding Blocked Countries

  1. Go to your site's Settings page
  2. Find the "Country Blocking" section
  3. Select countries to block from the list (stored as ISO 3166-1 alpha-2 codes, e.g. DE, US)
  4. Save your settings

Common Country Codes

CodeCountry
USUnited States
GBUnited Kingdom
CACanada
DEGermany
FRFrance
AUAustralia
CNChina

Important Considerations

Filtering is Immediate

Once you add an IP or country to your block list:

  • New pageviews from blocked sources are not recorded
  • Historical data is not affected
  • Changes take effect immediately

Filtering Does Not Block Access

Traffic filtering only affects analytics collection:

  • Blocked visitors can still access your website
  • They just won't appear in your analytics
  • For actual access blocking, use your web server or CDN

VPN and Proxy Considerations

Be aware that:

  • Users with VPNs may bypass country blocks
  • IP blocking works on the visible IP, not the actual origin
  • Proxy servers may cause different IP addresses

Best Practices

  • Block development traffic: Add your office and home IPs to exclude internal visits
  • Use CIDR for networks: Block entire office networks with CIDR notation
  • Document your blocks: Keep notes on why each IP/country is blocked
  • Review periodically: Remove outdated blocks when no longer needed
  • Don't over-block: Only block what's necessary to keep data clean

API Access

Manage traffic filters via API by updating site settings:

PUT https://api.invoker.app/api/sites/{site_id}
Authorization: Bearer YOUR_API_TOKEN

{
  "name": "My Website",
  "blocked_ips": [
    "192.168.1.100",
    "10.0.0.0/8"
  ],
  "blocked_countries": [
    "CN",
    "RU"
  ]
}