Skip to content

Add per-site pageview breakdown to pageview usage section#6097

Merged
sanne-san merged 3 commits intomasterfrom
sanne-pageviews-site-breakdown
Feb 26, 2026
Merged

Add per-site pageview breakdown to pageview usage section#6097
sanne-san merged 3 commits intomasterfrom
sanne-pageviews-site-breakdown

Conversation

@sanne-san
Copy link
Copy Markdown
Contributor

Changes

  • When a team has between 2 and 10 sites, the expandable pageview usage section now shows a breakdown of pageviews and custom events per site.
  • Teams with a single site or more than 10 sites see the existing aggregate-only view unchanged.
  • The breakdown section is expanded by default when no per-site breakdown is present. It is collapsed by default when a per-site breakdown is present, or when previous cycles are also present.

Tests

  • Automated tests have been added

Changelog

  • This PR does not make a user-facing change (not relevant to self-hosters)

Documentation

  • This change does not need a documentation update (Docs will be updated once all subscription settings changes have been implemented)

Dark mode

  • The UI has been tested both in dark and light mode

- When a team has between 2 and 10 sites, the expandable pageview usage section now shows a breakdown of pageviews and custom events per site.
- Teams with a single site or more than 10 sites see the existing aggregate-only view unchanged.
- The breakdown section is expanded by default when no per-site breakdown is present. It is collapsed by default when a per-site breakdown is present, or when previous cycles are also present.
@sanne-san sanne-san requested a review from a team February 25, 2026 17:40
Copy link
Copy Markdown
Member

@aerosol aerosol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some minor reservations with regards to querying code I'll post shortly, but main concern here is do we want to do that for teams having thousands of sites? IMHO our best best is to limit at some viewable maximum (10 maybe?) and order by top descending. nevermind, it's done, I have to wake up, sorry 😅

Copy link
Copy Markdown
Member

@aerosol aerosol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitted #6098 against this PR. Shouldn't hurt to include?

Instead of building a lookup map of all owned site ids,
we rely on clickhouse for sorting and limiting results,
and only if the resulting set is smaller than the predefined max,
a query to fill up inactive sites (zero events) is made.
@sanne-san sanne-san added this pull request to the merge queue Feb 26, 2026
@aerosol aerosol removed this pull request from the merge queue due to a manual request Feb 26, 2026
@sanne-san sanne-san added this pull request to the merge queue Feb 26, 2026
Merged via the queue into master with commit 9eb884e Feb 26, 2026
22 checks passed
@sanne-san sanne-san deleted the sanne-pageviews-site-breakdown branch February 26, 2026 09:18
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.

3 participants