google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.22k stars 279 forks source link

2nd tile has no data #8921

Closed kelvinballoo closed 2 weeks ago

kelvinballoo commented 2 months ago

Bug Description

While testing the audience segmentation epic, I noticed that the 2nd tile doesn't come with value at all. It is always 0, even if it actually should have data. Refer to the screenshots further down where I swapped the positions of an audience where there was a tile with numbers.

Steps to reproduce

  1. Set up 2 tiles under audience segmentation
  2. The 2nd tile will be 0 for the first 4 parameters (even if they should have data)
  3. You can swap the tile order to verify this. To swap, it's just a matter of unselecting the one you want second, save and reselect again.

Screenshots

When 'All Visitors' is in position 1, there is data for the first 4 lines with 5.9K visitors, etc... :

Screenshot 2024-06-20 at 19 18 23

When the same tile is swapped in position 2, there is no data. It's worth noting that the analytics figures at the bottom are showing accordingly.

Screenshot 2024-06-20 at 19 23 34

Additional Context


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

Acceptance criteria

Implementation Brief

Note: We can use https://github.com/google/site-kit-wp/pull/8997 as a starting point which covers the proposed fix.

Test Coverage

QA Brief

Changelog entry

techanvil commented 2 months ago

Note: I tested this out, with intermittent results. In my initial testing the bug only occurred when the first tile was in the zero data state. However, I tried it again while reviewing Question 3 in this comment, and found the bug occurred while the first tile did have data.

ankitrox commented 1 month ago

Hi @kelvinballoo ,

Thank you for reporting this issue.

  1. This seems to be a special case. We are trying to compare the data for last 28 days, but as we can see that New Visitors and Returning Visitors audiences are created only on 20th June, 2024.
  2. So essentially Google Analytics 4 does not have data for last 28 days to compare. If I change it to 14 days, we have the data to compare which is expected.
  3. Specifically for New Visitors and Returning Visitors, this issue will get addressed in #8144 for which we already have the ticket.

@techanvil Please let me know if we should handle this edge case for user created audiences. I think this should get addressed because user created audience can be created at later point and may get added in audience tile, so instead of showing the zero data in rows, we can display the current metrics value and partial data badge (which is already there).

@kelvinballoo Please look at this screencast which shows the above mentioned scenario in SK dashboard.

techanvil commented 1 month ago

Hi @ankitrox, as you've pointed out this issue can also occur with user-created audiences that we don't have the special-case handling for. So we do need a general fix for this issue.

techanvil commented 1 month ago

IB :white_check_mark:

mohitwp commented 3 weeks ago

QA Update ✅

_Latest environment_ ![image](https://github.com/user-attachments/assets/a892ac93-4386-4b47-8020-596a3263a864) _main environment_ ![image](https://github.com/user-attachments/assets/ea3c25fb-a596-4a9e-9c3b-168e9599610d) ![image](https://github.com/user-attachments/assets/b9b19aae-3880-4972-8a06-2d7a00331f22) ![image](https://github.com/user-attachments/assets/80fdd502-d90e-4268-a75a-8124cf9a6ba6) ![image](https://github.com/user-attachments/assets/d3e9582d-f805-45b4-8df4-0f5ead55fbb9)