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

Dashboard search visitors widget uses incorrect condition for whether to display zero data state #3880

Closed
felixarntz opened this issue Aug 16, 2021 · 3 comments
Labels
Module: Analytics Google Analytics module related issues P1 Medium priority Rollover Issues which role over to the next sprint Type: Bug Something isn't working
Milestone

Comments

@felixarntz
Copy link
Member

felixarntz commented Aug 16, 2021

Bug Description

There's a problem with the DashboardSearchVisitorsWidget, related to the improvements in #3064: Similar to how DashboardGoalsWidget does, that widget should only render in a WidgetZeroData state if there is actually no data at all, which in this case cannot be determined based on the regularly used query of the widget alone, since that widget only queries the users from Search. We need to make this check based on whether no users at all were present in the time, otherwise it can lead to incorrect and confusing UX (see below).

Screen Shot 2021-08-16 at 11 26 26 AM

The experience here is quite confusing since the All Traffic widget shows data (because there _is_ data, even if super little), while at the same time the small widget which should display the visitors from Search displays the "zero data" blue box below. There is data, so it's not like we're waiting for data in this scenario.

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

Acceptance criteria

  • The DashboardSearchVisitorsWidget should also get the number of total users in the period and only based on that show or not show the WidgetZeroData UI.
    • In other words, if there has been e.g. 1 user on the site in the past x days, but 0 of them came from Search, the widget should display 0 like it would display any other value. Only if there are no users at all, it should render in "zero data" state.

Implementation Brief

  • Using assets/js/modules/analytics/components/dashboard/DashboardSearchVisitorsWidget.js,
    • Query the total users via the getReport selector, passing the values for:
      • startDate
      • endDate
      • url
      • compareStartDate
      • compareEndDate
      • metrics: Array containing an object as follows:
         {
         	expression: 'ga:users',
         	alias: 'Total Users',
         }
    • Update the condition to display the WidgetReportZero component if the total users is zero in addition to the existing conditions.

Test Coverage

  • No new tests to be added.

Visual Regression Changes

  • N/A

QA Brief

  • To recreate the issue you will need to cover the following scenarios, and observe the Unique Visitors from Search widget under the search funnel section of the dashboard:
    • Zero total users, including from search (should display 'zero data' state)
    • One or more total users, but none from search (should display 0)
    • One or more visitors from search (should display the number)

Changelog entry

  • Fix Dashboard Search Widget zero state bug.
@felixarntz felixarntz added Type: Bug Something isn't working P1 Medium priority Module: Analytics Google Analytics module related issues labels Aug 16, 2021
@felixarntz felixarntz assigned felixarntz and unassigned felixarntz Aug 16, 2021
@asvinb asvinb assigned asvinb and unassigned asvinb Aug 23, 2021
@aaemnnosttv aaemnnosttv self-assigned this Aug 25, 2021
@aaemnnosttv
Copy link
Collaborator

IB ✅

@aaemnnosttv aaemnnosttv removed their assignment Aug 25, 2021
@johnPhillips johnPhillips self-assigned this Aug 25, 2021
@johnPhillips johnPhillips removed their assignment Aug 25, 2021
@eclarke1 eclarke1 added this to the Sprint 56 milestone Aug 26, 2021
@tofumatt tofumatt assigned tofumatt and unassigned tofumatt Aug 26, 2021
@cole10up cole10up self-assigned this Aug 30, 2021
@eclarke1 eclarke1 added the Rollover Issues which role over to the next sprint label Aug 31, 2021
@eclarke1 eclarke1 modified the milestones: Sprint 56, Sprint 57 Aug 31, 2021
@wpdarren wpdarren assigned wpdarren and unassigned cole10up Sep 8, 2021
@wpdarren
Copy link
Collaborator

wpdarren commented Sep 9, 2021

QA Update: ❌

@johnPhillips I have a test site that has zero search but does have user data in analytics in other channels. When I go to Site Kit Dashboard, an error appears. Not sure if this helps, but the error does not appear when you have search data. If you would like access to this site please let me know

image

@wpdarren
Copy link
Collaborator

QA Update: ✅

Observed the Unique Visitors from Search widget under the search funnel section of the dashboard:

Zero total users, including from search (should display 'zero data' state)
One or more total users, but none from search (should display 0)
One or more visitors from search (should display the number)

image

image

@johnPhillips I did notice that the graph underneath the Unique Visitors from Search widget was not displaying properly, but I think we have an issue for this already. I will double check and if not, create one. I did not want to hold this up because of we are looking to release today.

@wpdarren wpdarren removed their assignment Sep 13, 2021
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 P1 Medium priority Rollover Issues which role over to the next sprint Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants