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

Unified Dashboard: Register existing widgets in new Monetization area

Open tofumatt opened this issue 5 years ago • 12 comments

The widgets that should appear in the Speed area (created in #4031):

mainDashboardMonetizationPrimary area:

  1. AdSense summary chart widget (adsense/components/dashboard/ModuleOverviewWidget.js)
  2. AdSense top earning pages widget (DashboardTopEarningPagesWidget)

The Entity Dashboard will not have the Monetization section at all.


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

Acceptance criteria

These widgets should be registered to the following areas and appear on the Main Dashboard only, in this order:

mainDashboardMonetizationPrimary area:

  1. AdSense summary chart widget (adsense/components/dashboard/ModuleOverviewWidget.js)
  2. AdSense top earning pages widget (DashboardTopEarningPagesWidget)

The Entity Dashboard should not contain any Monetization widgets.

Implementation Brief

Inside assets/js/modules/adsense/index.js:

  • Import AREA_MAIN_DASHBOARD_MONETIZATION_PRIMARY from assets/js/googlesitekit/widgets/default-areas.js
  • Inside the call to widgetsAPI.registerWidget for the ModuleOverviewWidget:
    • Add AREA_MAIN_DASHBOARD_MONETIZATION_PRIMARY to the array passed as the last argument.
  • Inside the call to widgetsAPI.registerWidget for the DashboardTopEarningPagesWidget:
    • Add AREA_MAIN_DASHBOARD_MONETIZATION_PRIMARY to the array passed as the last argument.
    • Turn the width property of the second argument (the options object) into an array, with the current value (widgets.WIDGET_WIDTHS.HALF) as the first item. Add widgets.WIDGET_WIDTHS.FULL as a second item.

Test Coverage

  • Existing tests should pass, no new tests required.

QA Brief

  • Check that the AdSense ModuleOverviewWidget and DashboardTopEarningPagesWidget have new areas added.

Changelog entry

  • Add AdSense summary and top-earning pages widgets to the monetization area.

tofumatt avatar Sep 20 '21 16:09 tofumatt

@felixarntz Can you confirm these ACs make sense? See my notes at the top of the issue: the Design Doc didn't highlight that the Popular Pages shouldn't be in the Entity Dashboard, but I think it makes sense to exclude because it's site-wide info and not "relevant" to the Entity Dashboard.

If this looks good I'll file a follow-up issue for the Entity URL on the AdSense Dashboard widget.

tofumatt avatar Sep 20 '21 16:09 tofumatt

@tofumatt Yes, that's correct, good point.

About the AdSense summary widget though, the ACs here will actually need to be expanded - that was something we missed during PRD and design: The AdSense summary widget right now doesn't support entities, it always looks at the whole site and doesn't check if there is a current entity. That needs to be added, should be rather straightforward though.

Do you want to add this here or open a separate issue for it?

felixarntz avatar Sep 20 '21 17:09 felixarntz

I'll add a separate issue for that; for now I think it's fine if it shows "all site data" on the Entity Dashboard, and then we can update it accordingly in a separate issue.

tofumatt avatar Sep 20 '21 20:09 tofumatt

@tofumatt Sounds good.

for now I think it's fine if it shows "all site data" on the Entity Dashboard, and then we can update it accordingly in a separate issue.

"For now" yes, but we shouldn't launch it like that - just want to clarify that other issue also needs to be part of the epic :)

felixarntz avatar Sep 20 '21 21:09 felixarntz

@tofumatt Actually - the ACs here are not correct, on second glance I noticed that. What needs to show in the monetization section is not the current dashboard summary widget (DashboardSummaryWidget), but the current module overview widget (ModuleOverviewWidget) - see the PRD and design doc. That one has the historical chart and includes all the information from the DashboardSummaryWidget and more. The latter should no longer be used in the new UI (i.e. once the feature flag gets removed and the old UI goes away, that widget should be removed completely). Can you update the ACs accordingly?

felixarntz avatar Sep 20 '21 21:09 felixarntz

@tofumatt Okay, I took yet another look and have to change course again - sorry! We do have to use ModuleOverviewWidget, however the other issue to change it won't be necessary. Instead, we need to keep limiting AdSense to only the main dashboard, since the AdSense API doesn't even support URL-level reporting at this point.

In other words, the whole AC section about the entity dashboard can be removed from here.

I've summarized this here: https://docs.google.com/document/d/1StGx76XXisE9MfwM1916D9fn7-H9BRiRgizRejTsecI/edit#heading=h.2dyadtxyr11q

felixarntz avatar Sep 20 '21 21:09 felixarntz

@felixarntz Sounds good. Thanks for checking on the AdSense API—that was going to be my next step assuming the ACs sounded good, so I appreciate you checking 👍🏻

tofumatt avatar Sep 20 '21 22:09 tofumatt

@tofumatt The first point of the ACs is still off - it should be ModuleOverviewWidget, not DashboardSummaryWidget, see above :)

felixarntz avatar Sep 20 '21 22:09 felixarntz

@tofumatt Just to note I've done the IB using ModuleOverviewWidget instead of DashboardSummaryWidget as per @felixarntz's comment above. I'll assign you for IBR so you can give it all a review.

johnPhillips avatar Sep 21 '21 15:09 johnPhillips

Sorry, I could've sworn I edited that to show ModuleOverviewWidget in the ACs but I've made the update. Thanks!

Looks good to me, IB ✅

tofumatt avatar Sep 23 '21 21:09 tofumatt

@tofumatt I think I got the wrong end of the stick with the IB here and made it more complicated than necessary. I've redone it - could you give it a once-over? Thanks!

johnPhillips avatar Sep 27 '21 16:09 johnPhillips

✅ LGTM AdSense ModuleOverviewWidget and DashboardTopEarningPagesWidget have new areas added.

ivankruchkoff avatar Oct 06 '21 06:10 ivankruchkoff