AdSense stats/reporting fixes on the main dashboard
Feature Description
Main dashboard screen:
Top Earning Pages panel (First image below)
Revenue -> change "Revenue" to “Earnings” for consistency. Should be in currency format. Currently in plain number format.
Earning panel (Second image below)
RPM -> change "RPM" to “Page RPM” for consistency. There is no trend (red/green arrows & change) showing up for RPM. Should be in same currency format as RPM. Total Earnings -> Trend number format does not match the currency format of the main number. Ad Impressions -> Trend number is missing.

Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- In the AdSense summary widget on the Site Kit dashboard:
- The "RPM" label should be changed to "Page RPM".
- In the AdSense "Top Earning Pages" widget on the Site Kit dashboard:
- The "Revenue" column should have its label changed to "Earnings".
- Each value in that column should be formatted with the currency.
- In the AdSense "Performance by page over the last 28 days" widget on the AdSense module page:
- The "Earnings" and "Page RPM" columns should be formatted as a currency instead of plain numerics (similar to above in the "Top Earning Pages" widget on the Site Kit dashboard).
- These changes should be made to both the legacy version of the widgets as well as to the refactored versions.
Implementation Brief
- Using
assets/js/modules/adsense/components/dashboard/DashboardSummaryWidget.js, update the title of the firstDataBlockfromRPMtoPage RPM. - Using
assets/js/modules/adsense/components/dashboard/DashboardTopEarningPagesWidget.jsandassets/js/modules/adsense/components/module/ModuleTopEarningPagesWidget/Table.js, update thetitleandtooltipof the second column oftableColumnsfromRevenuetoEarnings. - Using
assets/js/modules/analytics/components/dashboard/LegacyAnalyticsAdSenseDashboardWidgetTopPagesTable.js,- Query the AdSense data store to get the currency by using the
getReportselector and passingEARNINGSasmetrics. The currency value can be found in the headers array from the response. - Update the
numFmtfunction of theEarningsandPage RPMcolumn values to use the currency style and passing the currency value from the previous bullet point.
- Query the AdSense data store to get the currency by using the
- The changes from the previous bullet point should be applied to
DashboardTopEarningPagesWidgetandModuleTopEarningPagesWidgetto values which are currencies.
Test Coverage
- N/A
Visual Regression Changes
- Text changes for the above components should be noted.
QA Brief
You will need to enable widgets.dashboard and widgets.moduleScreens, and have an AdSense account linked.
Note that the legacy versions of the dashboard widgets only appear if you disable widgets.dashboard. However, both the legacy and new widgets will appear on the AdSense module screen if you enable widgets.moduleScreens.
Also note: The work for this ticket now includes the ACs from https://github.com/google/site-kit-wp/issues/576 I've tried to make this a bit simpler to follow by using a checklist below.
Dashboard
AdSense summary widget
- The "RPM" label should be changed to "Page RPM".
- [ ] Legacy version
- [ ] Refactored version
AdSense "Top Earning Pages" widget:
- the "Revenue" column should have its label changed to "Earnings".
- [ ] Legacy version
- [ ] Refactored version
- the values in this column should be formatted with the currency
- [ ] Legacy version
- [ ] Refactored version
AdSense module page
'Performance by page over the last 28 days' widget
- should now have the values in the 'Earnings' and 'Page RPM' columns formatted with a currency.
- [ ] Legacy version (bottom of the page)
- [ ] Refactored version (top of the page)
Changelog entry
- Clarify some AdSense labels and format the monetary values in top earning pages tables with the relevant currency.
I've defined the ACs for this issue focused on the wording and formatting changes only and opened a separate #3091 for adding the two additional change values (with the latter being only done for the refactored widget, since it's not worth investing the time in the legacy version that will soon be phased out).
@felixarntz I added the IB which caters only for the text changes. For "Each value in that column should be formatted with the currency (related: #576, which does this on the AdSense module page).", @aaemnnosttv and I had a call to see whether it was possible or not, with the data being returned. Turns out that the response for the analytics request does not include the currency.

This is in comparison to responses to AdSense requests where we do have the currency:

One possible way of getting the currency is by querying the user profile and retrieve the currency from there: https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/profiles
Let me know what you think.
@asvinb Good point; relying on the Analytics profile used sounds good to me. Since we already know that profileID currently used in SIte Kit, maybe we should add a GET:profile REST data point and getProfile( profileID ) selector to get that.
Alternatively, I'm also not opposed to using a simple AdSense report query to get that information, since that is something we can already get easily without adding a new endpoint. Since the widget is technically an AdSense widget anyway, it wouldn't be a problem relying on both the Analytics and AdSense APIs together.
Sounds good @felixarntz . I think we can go the simple route, by running an AdSense report query. I've updated the IB to reflect that.
IB ✅
Update: I added the work from #576 to the QA brief after discussion with @felixarntz, because after having followed the IB here (which mentions ModuleTopEarningPagesWidget instead of DashboardTopEarningPagesWidget.js ) I realised I'd done some of the work from that issue.
My PR now deals with both issues.
For more context see the discussion on #576
QA Update: Pass ✅
Verified:
Dashboard:
- The "RPM" label is changed to "Page RPM" in both the legacy and refactored version.
- The "Revenue" column has its label changed to "Earnings" in both the legacy and refactored version.
- The values in this column is formatted with the currency, i.e. Euro in both the legacy and refactored version.

AdSense module page:
- Now has the values in the 'Earnings' and 'Page RPM' columns formatted with a currency in both the legacy and refactored version.
