For 'View Only dashboard' – CTAs that shared users can't use should not appear
See original GitHub issueBug Description
CTAs in the dashboard that are intended for admins, without any useful info or actionable links/items when viewed in a shared context, should not be shown to “shared”/view-only Dashboard users.
Instead, we should show a different CTA informing the user that the admin needs to take steps before the module will be useable. Alternatively, we could show the user nothing as there is currently nothing really to show.
Bug bash issue: https://app.asana.com/0/1202258919887896/1202419867342280 please refer to Asana issue for background
Steps to reproduce
- Connect AdSense module and enable AdSense module sharing in Site Kit.
- Ensure AdSense property is in a state that would cause a CTA to appear for the admin user
- Sign in as a “shared dashboard” user
- See the CTA intended for the admin
Screenshots
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The
AdSenseLinkCTAcomponent should not be shown in a view-only context
Implementation Brief
- In
assets/js/modules/adsense/components/dashboard/DashboardTopEarningPagesWidget.js: - Using the
useViewOnlyhook, return theWidgetNullcomponent if the user has view-only accessANDAdsense isn’t linked.
Test Coverage
- In
stories/module-adsense-components.stories.js, add a story to render theAdSenseLinkCTAcomponent if it isn’t view-only contextANDAdsense isn’t linked.
QA Brief
- Start off with AdSense in a state that would cause the “Link Analytics and AdSense” CTA to appear for the admin user
- Sign in with a user with permissions to view the module
- The “Link Analytics and AdSense” CTA should not show up for user with view only access.
Changelog entry
- Don’t show the “Link Analytics and AdSense” CTA on the view-only Dashboard.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Unable to view shared dashboard - Support Central!
I shared the Dashboard with a user. When I proxy in as them, this Dashboard does not appear. Why can't the user see...
Read more >Not able to view dashboard shared with me. - ServiceNow
Solved: When i try to view the report dashboard it says "Report visible only to a specific users of group. All other members...
Read more >Analyze your button calls-to-action (CTA) performance
On the Calls-to-action dashboard, you can find a list of your button CTAs. Filter your CTAs by using the dropdown menus above the...
Read more >7 Common Pitfalls of Call to Action Design - VWO Blog
If the user can't read it, the page won't be useful. They'll bounce off and you will lose your chances even before the...
Read more >3 CTA Types That Actually Work - Neil Patel
Always strive for a compelling offer that jumps out at users. Start by giving a compelling statement or headline in the first box....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The IB here will show a zero/gathering data state for users instead of the “Link AdSense and Analytics” CTA. Given the discussion above, I think it would be better to show nothing for AdSense + Analytics not being linked when a view-only user views AdSense widgets.
I think rendering nothing instead of the output here: https://github.com/google/site-kit-wp/blob/7fe9ecfc60ca934b698d229a68f8e59a1eab9658/assets/js/modules/adsense/components/dashboard/DashboardTopEarningPagesWidget.js#L197-L206 would be better in a view-only context if AdSense and Analytics aren’t linked…
Otherwise the above render will likely happen with the IB suggested, and that means view-only users will ALWAYS see this widget in a zero/gathering data state even though we’ll never gather data for it since it isn’t setup.
Let’s hide it entirely instead on a view-only dashboard.
@felixarntz the problem with showing the existing
DashboardZeroDatacomponent is more about the site steps that we can’t show for view-only users. These use deep links into the service that we can’t build (due to lack of settings) but also because we shouldn’t expect view-only users to be able to action them just like with other CTAs. I think we can simply make this part of the component conditional.Edit: nevermind, I missed the part of your comment about doing away with this custom zero data state 😄