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

Hide Key Metrics banner/widget area when SC and GA are in a Zero Data State #6512

Open
jimmymadon opened this issue Feb 1, 2023 · 13 comments
Labels
P1 Medium priority Type: Enhancement Improvement of an existing feature

Comments

@jimmymadon
Copy link
Collaborator

jimmymadon commented Feb 1, 2023

Feature Description

This requirement was split out of #6209 as that issue was getting too large as per this comment.

Ideally, we do not want to show the Key Metrics Setup CTA widget on the dashboard if SC or Analytics are either in Gathering Data or Zero Data states. To avoid "flickers" where the widget is first shown and then hidden immediately after we've loaded our reports to check for gathering data / zero data, we created #5933 which "pre-loads" information regarding gathering data and this issue is supposed to tackle the same concern for zero data.

However, since zero data is not really a plugin "state" but depends on the date range selected in the plugin, it is not possible to pre-load this information.


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

Acceptance criteria

  • When loading the Site Kit dashboard, if Search Console and GA4 return "zero data", the Key Metrics Setup CTA widget should not be displayed. (The Key Metrics widget area should not be displayed at all).
  • When on subsequent page loads, if Search Console and GA4 do NOT return "zero data", the Key Metrics Setup CTA should be displayed.
  • Once the dashboard is loaded, the Setup CTA should not pop up and cause movement on the page if the site "leaves" the zero data state. The Setup CTA should only be displayed on a page load (/reload).
  • If in the rare case that the site "enters" zero data state after the Key Metrics widget has been setup, then nothing should happen, ie. the Key Metrics widget should still be displayed the way it was before the site entered zero data state.

Implementation Brief

Notes for IB author:

  • When loading the Site Kit dashboard, check if Search Console and GA4 return Zero Data for the date range selected. If they do NOT return zero data, set the isWidgetHidden flag in the Key Metrics setting to false.
  • Ensure the default value for the isWidgetHidden flag is set to true.
  • Use the isWidgetHidden flag to show/hide the widgets registered to the Key Metrics widget area.

Test Coverage

QA Brief

Changelog entry

@jimmymadon jimmymadon self-assigned this Feb 1, 2023
@jimmymadon jimmymadon added P1 Medium priority Type: Enhancement Improvement of an existing feature labels Feb 1, 2023
@jimmymadon
Copy link
Collaborator Author

@aaemnnosttv Should this issue follow a similar approach (ACs / IB) to #5933? Currently, we don't even have a straightforward isZeroData selector - we fetch a full report and pass it to the isZeroReport util function. So this would be yet another big issue.

@jimmymadon jimmymadon added the Team Review Issue needs to be reviewed by team for triaging label Feb 14, 2023
@jimmymadon
Copy link
Collaborator Author

@marrrmarrr Based on a quick 1:1 with @aaemnnosttv, we realised that Zero Data depends on a specific date range and hence, pre-loading this "state" is not going to be easy on the dashboard. Some options:

  1. We can reconsider the behaviour of the Key Metrics widget so that it is not completely hidden but the another "Banner" is displayed in this widget area instead. This will prevent any "flickers" that would arise if the widget was displayed momentarily while the plugin is computing a "zero data report" state.
  2. Alternatively, we can simply allow Key metrics to be setup and displayed even in Zero data state since they can still be "meaningful" to a certain extent?

We can discuss this in our next team review meeting perhaps.

c.c. @kuasha420

@jimmymadon jimmymadon assigned jimmymadon and unassigned jimmymadon Feb 15, 2023
@marrrmarrr
Copy link
Collaborator

Hey @jimmymadon, just one thing to clarify -- this would apply only to initial setup CTA for the KMW, correct?

@aaemnnosttv and I discussed this question briefly as well last week, and there was also an option 3, namely show the KMW setup CTA the following time a user logs in after we detect a site is no longer in zero state. So this flow would be:

  • user logs in --> check if there are stats to show for the site
    • if no stats, do nothing
    • if there are stats, make a note that the site has "left" zero state
  • next time the user logs in after the site "left" zero state, render the KMW CTA.

Curious to hear everyone's thoughts on this option.

@jimmymadon
Copy link
Collaborator Author

@marrrmarrr Great solution - we could actually use the isWidgetHidden flag that we set in the database or another flag. Would it have to be after the next login or could it be on the next page reload of the dashboard? I guess the former would be better UX but the latter will be easier to implement.

@jimmymadon
Copy link
Collaborator Author

just one thing to clarify -- this would apply only to initial setup CTA for the KMW, correct?

Yes - this check will occur for the Setup CTA. I believe if we don't show the Setup CTA until the site has data, there won't arise a scenario where the site is in Zero Data and the Key Metrics widget is setup?

@marrrmarrr
Copy link
Collaborator

@jimmymadon I think the next page reload is also fine, as long as it's a "new view", so we avoid the jumpiness of elements shifting vertically.
Regarding zero data, I think we currently call more than one state "zero data", so sometimes confusion arises. There are a few options:

  1. recently created site, no visitors yet, so widgets show zeros
  2. site which didn't have SC/GA accounts prior to setting up SK - will be in zero/gathering data state until stats are aggregated, then might either start showing stats or go into state (1) above if not enough visitors.
  3. site which for some reason lost all traffic -- eventually the dashboard would zero out.

In case (3), it could happen that the already existing KMW shows all zeros. Admittedly this is a corner case.

@marrrmarrr marrrmarrr removed their assignment Feb 17, 2023
@jimmymadon
Copy link
Collaborator Author

@marrrmarrr It is possible to not show the widget tiles if the site enters into a zero state after the Key Metrics have been set up. However, this could be confusing to users who were used to seeing the widget to have it suddenly disappear. The Zero Data notification may pop up though which could give them an indication. So what should the ideal behaviour be if the site enters zero data state after KM set up? Show zero tiles (do nothing) or hide the widget?

@jimmymadon jimmymadon removed the Team Review Issue needs to be reviewed by team for triaging label Feb 20, 2023
@jimmymadon jimmymadon removed their assignment Feb 21, 2023
@tofumatt tofumatt self-assigned this Feb 21, 2023
@aaemnnosttv aaemnnosttv self-assigned this Feb 21, 2023
@tofumatt tofumatt assigned tofumatt and unassigned tofumatt and aaemnnosttv Feb 21, 2023
@aaemnnosttv
Copy link
Collaborator

aaemnnosttv commented Feb 21, 2023

After discussing a bit with @felixarntz today, we decided it would be good to open a new issue to implement the persistent zero data handling as an extension of the related work we've done in #5933. I'll open an issue for that one and which this issue will depend on and be much simpler to implement.

@tofumatt tofumatt removed their assignment Feb 23, 2023
@tofumatt
Copy link
Collaborator

@aaemnnosttv Not sure why I was assigned to this IB, I think I was just reviewing the ACs but I've unassigned myself—I don't think there's anything special here that needs me unless I'm mixed up on something 🙂

@jimmymadon
Copy link
Collaborator Author

@aaemnnosttv Was a new issue created or worked on that is similar to #5933 for persistent Zero Data handling?

@jimmymadon
Copy link
Collaborator Author

@marrrmarrr As mentioned on our last "Updates and Planning" call, @aaemnnosttv, @kuasha420 and I discussed this issue at the last AC sync. The ACs defined currently based on our previous discussions do "make sense". However, the implementation will be fiddly and cumbersome, especially with the last AC point where a site could potentially re-enter the Zero data state. This issue introduces complexity for what we think is little "value". And as we have discussed in the past, for some users, having 'zeros' displayed in the Key Metrics could be a good thing. So we suggest to stall this until the end of the engineering for this epic. What do you think?

@marrrmarrr
Copy link
Collaborator

@jimmymadon if it's significant work to get this done, sounds good to postpone it.

@jimmymadon
Copy link
Collaborator Author

@aaemnnosttv @kuasha420 Will stall this for now and re-visit when we have almost finished the engineering for this epic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Medium priority Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

4 participants