site-kit-wp icon indicating copy to clipboard operation
site-kit-wp copied to clipboard

Partial data badges showing incorrectly when property is in partial data state

Open wpdarren opened this issue 1 year ago • 5 comments

Bug Description

Reported during the bug bash. Asana ticket here

When the GA property is in the partial data state neither the audience or "Top content" partial data badge should display in the audience tiles.

However, the audience partial data badge briefly appears while the property partial data state is being determined, and the "Top content" partial data badge appears and stays in the tile.

image


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

Acceptance criteria

  • Neither of the partial data badges in an audience tile should be displayed until the partial data state for the currently connected Analytics property, the audience, and the googlesitekit_post_type custom dimension have been determined.
    • This is to ensure that neither of the badges will briefly show up before being removed once the state has been been fully resolved.
  • Neither of the partial data badges in an audience tile should be displayed if the property is in the partial data state.

Implementation Brief

  • [x] In assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/index.js
    • While determining whether the audience is in partial data state, check if isPropertyPartialData is undefined, return false within useInViewSelect if it is undefined or true.
    • While determining whether top content is in partial data state, isTopContentPartialData, check if isPropertyPartialData is undefined, return false within useInViewSelect if it is undefined or true.

Test Coverage

  • Add the JS test for ensuring Partial Data badge doesn't show for audience tile or top content when analytics property is in partial data state.

QA Brief

  • Set up Site Kit and connect Analytics using a property which is in the partial data state. It's preferable for the property to be in the partial data state over the past 28 days, if it's only partial over the past 90 days it should be possible to quickly change the selected date range when the page loads to test the issue.
  • The property needs to have at least one user-defined audience with non-zero data over the past 90 days already set up.
  • Click on Enable groups to set up Audience Segmentation.
  • Verify the partial data badges at the top of the user-defined audiences don't briefly appear.
  • Verify the partial data badges for the "Top content" metric area don't appear at all.

Changelog entry

  • Ensure partial data badges display correctly when the connected Analytics property is in the partial data state.

wpdarren avatar Oct 08 '24 07:10 wpdarren

IB ✅

techanvil avatar Oct 14 '24 10:10 techanvil

QA Update ⚠

Hi @techanvil , I tested this and the results are not as expected. This is the way I am testing:

  • Set up SK and to create a new analytics property with a user-defined audience

  • I am setting up the Tester plugin with random data and partial data state for 28 days + AS flag on. Image below is the partial state config.

    Image

  • I enabled the groups. Initially, there was only one tile (user-defined one) that appeared without 'Partial data' badge. I then added one more tile to it and then both tiles had the partial data badge at the top content area. Video is attached for reference.

    Image

    https://github.com/user-attachments/assets/428c9d69-0bd9-474f-8035-041cf1d5db6f

QUESTION: It looks like an issue because we are expecting the 'Partial Data' badge not to appear at the Top content area. Let me know your thoughts on this. The good thing is that the flicker/brief appearance at the top is no longer there.

kelvinballoo avatar Oct 23 '24 16:10 kelvinballoo

Hi @kelvinballoo, thanks for spotting this! We someone managed to miss that one. I've created a followup PR to address the issue: https://github.com/google/site-kit-wp/pull/9554

techanvil avatar Oct 24 '24 09:10 techanvil

Thanks for the follow-up fix, @techanvil.

Sending it back to you for another pass, @kelvinballoo.

hussain-t avatar Oct 24 '24 18:10 hussain-t

QA Update ✅

Verified good as follows. Moving ticket to approval.

  • SK was set up and used the tester plugin to set it to partial data state.

  • Analytics property connected had at least one user-defined audience with non-zero data.

  • When clicking on Enable groups to set up Audience Segmentation:

    • The partial data badges at the top of the user-defined audiences do not briefly appear. ✅
    • The partial data badges for the "Top content" metric area don't appear at all. ✅

    https://github.com/user-attachments/assets/ace19700-4c5e-4b30-ac99-f7edd998c722

kelvinballoo avatar Oct 24 '24 19:10 kelvinballoo