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

AdSense dashboard: fix number formatting

Open OisinOConnor opened this issue 7 years ago • 6 comments

Fixing small things with the AdSense reporting screen

Summary: Some of the numbers are wrongly formatted and a few other tweaks. Details below.

AdSense reporting screen (First image below):

Performance over previous 28 days highlights panel Page RPM: should be in currency format. Currently plain number.

Performance over 28 days panel (page title list when linked with GA) Earnings: should be in currency format. Currently plain number. Page RPM: should be in currency format. Currently plain number.

Image3

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

Acceptance criteria

  • The values in the "Earnings" and "Page RPM" columns of the "Performance by page over the last 28 days" widget on the AdSense module page should be formatted as a currency instead of plain numerics.
  • This change should be made to both the legacy version of this widget as well as to the refactored version (see #2066).

Implementation Brief

Changelog entry

OisinOConnor avatar Sep 23 '19 16:09 OisinOConnor

In parts this has already been addressed through the new version of the "Performance" widget, but it's still relevant for the "Performance by page" widget.

felixarntz avatar Mar 29 '21 19:03 felixarntz

@felixarntz I picked up https://github.com/google/site-kit-wp/issues/656 and have been working through the IB. It covers adding currencies to the values in LegacyAnalyticsAdSenseDashboardWidgetTopPagesTable, DashboardTopEarningPagesWidget and ModuleTopEarningPagesWidget.

Just wondering if this issue is effectively a duplicate?

johnPhillips avatar Apr 15 '21 13:04 johnPhillips

@johnPhillips From an ACs perspective, these two are not duplicates since this one only touches the AdSense module page while #656 only touches the overall Site Kit dashboard. As far as I can tell:

  • The LegacyAnalyticsAdSenseDashboardWidgetTopPagesTable component is related to this issue, not #656. Instead, the LegacyAdSenseDashboardWidgetTopPagesTableSmall component is the one that relates to #656, since that component is rendered on the Site Kit dashboard.
  • The ModuleTopEarningPagesWidget also is only related to this issue since it's for the AdSense module page, not the Site Kit dashboard.

So the work to format numbers across these components is almost the same, but they are technically part of the different issues based on where the components are used.

I'm not opposed to handling all of them in one issue, but then please make sure to cross-reference it, and also include LegacyAdSenseDashboardWidgetTopPagesTableSmall, which you haven't mentioned above. Let me know if you prefer to do that, then I can update the ACs in #656 and close this one.

felixarntz avatar Apr 15 '21 20:04 felixarntz

Hi @felixarntz, thanks for clearing this up.

I was looking at the IB on #656 and I think that's where the confusion is. It mentions LegacyAnalyticsAdSenseDashboardWidgetTopPagesTable and ModuleTopEarningPagesWidget, which should be (as you say) covered by this ticket. It also makes no mention of LegacyAdSenseDashboardWidgetTopPagesTableSmall.

I'm most of the way through that IB now, and in doing so I have touched those files and therefore probably overlapped into this issue 🤦‍♂️

At this point perhaps it makes sense to just do the lot in one go, if you are ok with that. What do you think?

johnPhillips avatar Apr 16 '21 13:04 johnPhillips

@felixarntz I've gone through all this and updated my PR. I've also updated the QAB on #656 to include this work. Hopefully I caught everything! I hope you don't mind, but I assigned you for CR because it's probably a lot for someone else to keep track of.

FYI a couple of things I noticed with LegacyAdSenseDashboardWidgetTopPagesTableSmall:

  • it needed to be refactored into a functional component to use the useSelect hook and ReportTable component.
  • like LegacyAnalyticsAdSenseDashboardWidgetTopPagesTable it also didn't include deep links (see https://github.com/google/site-kit-wp/issues/2951), so I added these.

I'll add a note about this on the PR.

johnPhillips avatar Apr 22 '21 11:04 johnPhillips

@johnPhillips Sounds good. I've updated the ACs on #656 accordingly, closing this one.

felixarntz avatar Apr 26 '21 21:04 felixarntz