Automattic / Automattic/jetpack

Different Annual Site Data returned from/insights and /visits endpoints

Open
#36,660 7 comments 0 reactions 1 assignee Claimed by @dognose24 View on GitHub
[Feature] Stats Data [Feature] WPCOM API [Platform] Atomic [Platform] Simple [Plugin] Jetpack [Pri] Normal [Status] Priority Review Triggered Bug Customer Report [LEGACY] Triaged
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

### Impacted plugin

Jetpack

### Quick summary

`/stats/visits?unit=year` and `stats/insights` endpoints return different data for the same data points. It results in differences in numbers shown on `Insights` or `Traffic` pages on the web:

- 5437 vs 5462 comments
- 11246 vs 11234 likes

| Insights | Traffic |
| ----------- | ----------- |
| Different numbers | 2022 |

### Steps to reproduce

1. Select a higher-traffic site
2. Go to Stats
3. Select the Traffic tab
4. Change the date range from Days to Years on the chart
5. Select a year
6. Make a note of "Likes" and "Comments" numbers
7. Select the Traffic tab
8. Select View all annual insights
9. Make a note of "Likes" and "Comments" numbers for the same year
10. Notice a difference

### A clear and concise description of what you expected to happen.

The same data points should have the same values on different Stats pages (or endpoints).

### What actually happened

The same data points have different values on different Stats pages (or endpoints).

### Impact

Most (> 50%)

### Available workarounds?

No but the platform is still usable

### Platform (Simple and/or Atomic)

Simple, Atomic, Self-hosted

### Logs or notes

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.