site-kit-wp
site-kit-wp copied to clipboard
Visual difference in the view only vs standard SK dashboard with number of KMW tiles shown
Bug Description
We seem to be doing something differently when it comes to the view only SK dashboard compared to the standard dashboard if there are less than the maximum 4 key metric tiles added. "View only" users can also select the key metrics tiles to be viewed, but there are no placeholder "Add a metric" tiles for these users. Screenshots with examples below.
Note that it's possible that for view only users, tiles should not be available for selection, in particular if it requires the creation of custom dimensions.
Standard SK dashboard below - which shows placeholder tiles in place if less than 4 key metrics are selection
View only dashboard via Dashboard Sharing below - When 2 or 3 tiles are displayed, they stretch to the full width of the page and there is no additionl placeholder "Add metric" tile
Steps to reproduce
- Activate 2 or 3 key metric tiles and ensure all is working as expected
- Via dashboard sharing, grant access to GA for other users
- Login to the site from another user account (ie. An editor role), and access the view only SK dashboard
- Notice there is no "Add a metric" tile, yet there is the expected "Change metrics" link
Screenshots
Additional Context
- SK 1.126.0
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
- [ ]
Test Coverage
QA Brief
Changelog entry
@jamesozzie I've tried to reproduce your situation but there is definitely something else going on here. View only users should be able to select any of their own metrics when dashboard sharing is enabled. I am able to see the "Add a metric" CTA tile when logged in as a view only user.
View only users can select their own metrics via the "Change metrics" link only in my case, but without any "add a metric" box. Tested this on two sites today. Happy to jump on a call. I also sent you an "editor" profile login so you can view this issue on a live site @jimmymadon.
ACs here make sense, I think this should be fixable by setting the module to be Analytics instead, as long as that won't break things for users who only have Search Console shared. If not I guess it needs to be an OR type thing, which might be more complicated (unless we already have that and I forgot 😅).
Moving to IB 👍🏻
@jimmymadon The approach here will work, but thinking about it, it seems to sort of "hide" the intention of the modules attribute there. We don't really want/need to register those widgets if neither module is available, and that's helpful context to have in the code. (Otherwise we would just rely on isActive checks for all widgets. 😅)
I guess given there's the isActive check here though it's fine, and I'm probably overthinking it.
Maybe it'd be nice to add a check for at least one of either Search Console or Analytics being active in the isActive check, but I don't think it's needed. It just makes it a bit easier to grok the intent of the code, but functionally it won't matter 😄
IB ✅
@ankitrox @hussain-t @tofumatt Have updated the ACs here to meet the requirements of Analytics Conversion Reporting which was not present when this issue was created.
Thanks for confirming it, @jimmymadon!
Hi @ankitrox, I've updated the QAB to test the following from the updated AC:
If the conversionReporting feature flag is on, then the "Add a metric" tile(s) should be visible at all times when there are less than 8 metrics (ie. so 5, 6 or 7 metrics selected) available on the "View Only" dashboard for a user.
QA Update ⚠
- Tested on dev environment.
- Tested metric selection functionality on both main and view only dashboard.
- Tested when
'conversionInfra'feature flag is not enabled. - Tested when
'conversionInfra'feature flag is enabled. - Tested when only analytics module is shared via dashboard sharing.
@ankitrox I followed the steps to reproduce the issue and noticed that, when a user visits the view-only dashboard for the first time, three tiles appear, stretched to the full width of the page, with no additional 'Add Metric' placeholder tile. The 'Add Metric' placeholder tile only appears after the user makes changes to the selection. Is this the expected behavior? As per AC - The "Add a metric" tile(s) should be visible at all times when there are less than 4 metrics available on the "View Only" dashboard for a user.
https://github.com/user-attachments/assets/ad1eb35f-7437-4dcf-87e0-c6481df09ac3
@mohitwp Thanks for looking into this and raising the concern.
The issue you flagged is the existing one. This happens when the primary admin sets up the key metrics without going through answer based flow and selects the metrics using Select your metrics link.
In this case, getKeyMetrics selector neither have user metrics nor answer based metrics as can be seen here: https://github.com/google/site-kit-wp/blob/2ddc6a4057cc2188dcad2e16155d29f5624d1e3a/assets/js/googlesitekit/datastore/user/key-metrics.js#L216-L251
In such case, these four metrics will be shared with view only user.
KM_ANALYTICS_NEW_VISITORS,
KM_ANALYTICS_TOP_TRAFFIC_SOURCE,
KM_ANALYTICS_ENGAGED_TRAFFIC_SOURCE,
KM_SEARCH_CONSOLE_POPULAR_KEYWORDS,
When primary admin shares only Analytics module with view only, the last metric KM_SEARCH_CONSOLE_POPULAR_KEYWORDS is not available.
As discussed we can create a separate issue for this @mohitwp
CC: @techanvil
QA Update ✅
- Tested on dev environment.
- Tested metric selection functionality on both main and view only dashboard.
- Tested when
'conversionInfra'feature flag is not enabled. - Tested when
'conversionInfra'feature flag is enabled. - Tested when only analytics module is shared via dashboard sharing.
- Verified issue is resolve now and 'Add a metric' placeholder tile is showing now on 'View only dashboard'.
- Note :- For the issue reported above I created a separate ticket https://github.com/google/site-kit-wp/issues/9679
https://github.com/user-attachments/assets/ad1eb35f-7437-4dcf-87e0-c6481df09ac3