IP Exclusions
Your own visits, internal team activity, and known bot IPs are skewing your analytics. HitKeep’s IP exclusion system lets you block specific IPs or CIDR ranges from being recorded, either per-site or globally across the entire instance.
Per-Site Exclusions
Section titled “Per-Site Exclusions”Block specific traffic from a single site. This is the right choice for filtering out your own IP without affecting other sites.
# Add an IP exclusion for a sitecurl -X POST https://your-hitkeep.example/api/sites/{site_id}/exclusions \ -H "Content-Type: application/json" \ -b "hk_token=YOUR_SESSION_COOKIE" \ -d '{"ip":"203.0.113.42"}'
# Add a CIDR rangecurl -X POST https://your-hitkeep.example/api/sites/{site_id}/exclusions \ -H "Content-Type: application/json" \ -b "hk_token=YOUR_SESSION_COOKIE" \ -d '{"ip":"10.0.0.0/8"}'Dashboard Workflow
Section titled “Dashboard Workflow”- Open your site in the dashboard.
- Go to Settings → Exclusions.
- Enter an IP address or CIDR range and click Add.
Hits from excluded IPs are dropped at the ingestion layer before being stored.
List and Remove Rules
Section titled “List and Remove Rules”# List active exclusion rules for a sitecurl https://your-hitkeep.example/api/sites/{site_id}/exclusions \ -b "hk_token=YOUR_SESSION_COOKIE"
# Remove an exclusion rulecurl -X DELETE https://your-hitkeep.example/api/sites/{site_id}/exclusions/{rule_id} \ -b "hk_token=YOUR_SESSION_COOKIE"Instance-Wide Exclusions (Admin)
Section titled “Instance-Wide Exclusions (Admin)”Instance administrators can add global exclusion rules that apply across all sites. Use this for known datacenter IP ranges, monitoring bots, or your entire office subnet.
# List global exclusion rules (admin only)curl https://your-hitkeep.example/api/admin/exclusions \ -b "hk_token=ADMIN_SESSION_COOKIE"
# Add a global exclusion rulecurl -X POST https://your-hitkeep.example/api/admin/exclusions \ -H "Content-Type: application/json" \ -b "hk_token=ADMIN_SESSION_COOKIE" \ -d '{"ip":"198.51.100.0/24"}'
# Remove a global exclusion rulecurl -X DELETE https://your-hitkeep.example/api/admin/exclusions/{rule_id} \ -b "hk_token=ADMIN_SESSION_COOKIE"Finding Your Current IP
Section titled “Finding Your Current IP”curl https://your-hitkeep.example/api/user/current-ip \ -b "hk_token=YOUR_SESSION_COOKIE"This endpoint returns the IP address HitKeep sees for your current connection, accounting for trusted proxy headers if configured.
Related
Section titled “Related”Need automatic bot filtering based on user-agent lists or threat intelligence feeds? Join the HitKeep Cloud waitlist →