Automattic / Automattic/jetpack

Enhancement Request: Enable IP exclusions in Jetpack Stats for cached environments

Open
#40,778 1 comment 0 reactions 0 assignees View on GitHub
[Feature] Stats Data [Plugin] Jetpack [Pri] Low Customer Report [LEGACY] Enhancement Triaged
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

### Impacted plugin

Jetpack

### What

Support IP exclusions in Jetpack Stats with cached sites

### How

The current implementation of the `jetpack_stats_excluded_ips` filter does not work for sites using caching, as the logic to exclude IPs relies on dynamically determining visitor IP addresses before serving the tracking script. Cached pages bypass this logic, resulting in the inability to exclude specific IPs from being tracked.

This issue was initially reported by a user on an Atomic site ([ephillc.com](https://ephillc.com/)) reported here: https://github.com/Automattic/jpop-issues/issues/9399, but affects all users relying on caching for performance.

This was initially reported by a user and here's the follow-up ticket where we let them know: 9226409-zd-a8c

Contributor guide

Open the contributing guide

Research direction

Start by tracing the jetpack_stats_excluded_ips filter and the Jetpack Stats tracking-script path, then investigate how cached pages bypass dynamic visitor-IP detection. Reproduce the behavior on a cached site and verify that configured IP exclusions prevent tracking for both cached and uncached pages.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
analytics, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.