Skip to content

Fix zero-valued metrics in event:page breakdown responses#95

Open
PepperCat-YamanekoVillage wants to merge 1 commit into
vinceanalytics:mainfrom
PepperCat-YamanekoVillage:fix-events-0
Open

Fix zero-valued metrics in event:page breakdown responses#95
PepperCat-YamanekoVillage wants to merge 1 commit into
vinceanalytics:mainfrom
PepperCat-YamanekoVillage:fix-events-0

Conversation

@PepperCat-YamanekoVillage

Copy link
Copy Markdown

Fix zero-valued metrics in event:page breakdown responses

Summary

This PR fixes an issue where the event:page breakdown endpoint returned page entries with all metric values set to 0, despite aggregate statistics showing non-zero values for the same period.

Problem

Aggregate statistics were reported correctly, but page-level breakdowns using property=event:page returned rows with zero-valued metrics.

For example:

Aggregate request:

GET /api/v1/stats/aggregate?site_id=<site>&period=today&metrics=visitors,pageviews,visits,events

Aggregate response:

{
  "events": 0,
  "pageviews": 165,
  "visitors": 122,
  "visits": 132
}

Breakdown request:

GET /api/v1/stats/breakdown?site_id=<site>&period=today&property=event:page&metrics=visitors,pageviews,events&limit=20

Breakdown response:

{
  "events": 0,
  "page": "/articles/selfhosted/",
  "pageviews": 0,
  "visitors": 0
}

The issue was reproducible not only with period=custom, but also with other periods such as today and yesterday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant