Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect figures in All Traffic widget pie charts #10243

Open
3 tasks
techanvil opened this issue Feb 18, 2025 · 1 comment
Open
3 tasks

Incorrect figures in All Traffic widget pie charts #10243

techanvil opened this issue Feb 18, 2025 · 1 comment
Labels
Module: Analytics Google Analytics module related issues P0 High priority Team M Issues for Squad 2 Type: Bug Something isn't working Type: Support Support request

Comments

@techanvil
Copy link
Collaborator

techanvil commented Feb 18, 2025

Bug Description

As reported in the support forum, the "others" segment in the Locations pie chart does not have the correct user count.

Furthermore, the percentages displayed in the pie chart tooltips can differ from the percentages displayed in the chart. This has been observed in the Channels pie chart.

Steps to reproduce

  1. Install Site Kit and connect Analytics.
  2. Navigate to the All Traffic widget.
  3. Click on the pie chart dimensions and hover over the chart segments.
  4. See that the user count and percentage displayed in the tooltip do not make sense in some cases.
  5. See the screenshots below for examples.

Screenshots

All Traffic widget:
Image
Here's the All Traffic widget for context. Note that a custom 1 day range is specified, this was introduced for testing in order to ensure the "all visitors" count was not rounded. The defects will occur regardless of the date range.

It's important to note that the sum of the user counts in the segments may not match the "all visitors" count. This is to be expected, because users may be counted multiple times if they appear in different segments. The percentages displayed should therefore be relative to the sum of the segments in order to provide a meaningful comparison (essentially, so that the percentages add up to 100%). The percentages currently displayed in the segments are correct, while the tooltips can be incorrect as shown below.

Channels pie chart:
Image
Here it can be seen that the percentages displayed in the tooltips don't match the percentages displayed in the chart.

Locations pie chart:
Image
Here it can be seen that the "others" segment in the Locations pie chart does not have the correct user count (clearly, 17.6% should be less than 19 users if 5.9% is 9 users. The example provided in the forum post provides a more readily apparent example of this defect).

Additional Context

  • PHP Version: any
  • OS: any
  • Browser: any
  • Plugin Version: spotted in 1.146.0
  • Device: any

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The "others" segment in the Locations pie chart should have the correct user count.
  • The percentages displayed in the pie chart tooltips should match the percentages displayed in the chart.

Implementation Brief

  • Always calculate the pie chart percentages relative to the sum of the segments.
  • Remove the 6 row limit from the pie chart report as this can result in an incomplete sum for the "others" segment.
  • Complete and merge this draft PR: Fix incorrect figures in All Traffic widget pie charts #10244
    • The PR should be functionally complete and just need tests/Storybook to be updated as necessary, and possibly a bit of tidying up.

Test Coverage

  • Fix any failing tests.
  • Ensure any related stories & VRTs still work/pass.

QA Brief

Changelog entry

@techanvil techanvil added Module: Analytics Google Analytics module related issues Type: Bug Something isn't working labels Feb 18, 2025
@techanvil techanvil self-assigned this Feb 18, 2025
@techanvil techanvil added the P0 High priority label Feb 18, 2025
@jamesozzie jamesozzie added the Type: Support Support request label Feb 18, 2025
@techanvil techanvil removed their assignment Feb 18, 2025
@eugene-manuilov eugene-manuilov self-assigned this Feb 19, 2025
@eugene-manuilov
Copy link
Collaborator

IB ✔

@eugene-manuilov eugene-manuilov removed their assignment Feb 19, 2025
@ivonac4 ivonac4 added the Team M Issues for Squad 2 label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: Analytics Google Analytics module related issues P0 High priority Team M Issues for Squad 2 Type: Bug Something isn't working Type: Support Support request
Projects
None yet
Development

No branches or pull requests

4 participants