Unified Dashboard: Register existing widgets in new Monetization area
The widgets that should appear in the Speed area (created in #4031):
mainDashboardMonetizationPrimary area:
- AdSense summary chart widget (
adsense/components/dashboard/ModuleOverviewWidget.js) - 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:
- AdSense summary chart widget (
adsense/components/dashboard/ModuleOverviewWidget.js) - 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_PRIMARYfromassets/js/googlesitekit/widgets/default-areas.js - Inside the call to widgetsAPI.registerWidget for the
ModuleOverviewWidget:- Add
AREA_MAIN_DASHBOARD_MONETIZATION_PRIMARYto the array passed as the last argument.
- Add
- Inside the call to widgetsAPI.registerWidget for the
DashboardTopEarningPagesWidget:- Add
AREA_MAIN_DASHBOARD_MONETIZATION_PRIMARYto the array passed as the last argument. - Turn the
widthproperty of the second argument (theoptionsobject) into an array, with the current value (widgets.WIDGET_WIDTHS.HALF) as the first item. Addwidgets.WIDGET_WIDTHS.FULLas a second item.
- Add
Test Coverage
- Existing tests should pass, no new tests required.
QA Brief
- Check that the AdSense
ModuleOverviewWidgetandDashboardTopEarningPagesWidgethave new areas added.
Changelog entry
- Add AdSense summary and top-earning pages widgets to the monetization area.
@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 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?
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 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 :)
@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?
@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 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 The first point of the ACs is still off - it should be ModuleOverviewWidget, not DashboardSummaryWidget, see above :)
@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.
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 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!
✅ LGTM AdSense ModuleOverviewWidget and DashboardTopEarningPagesWidget have new areas added.