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

Add date filters for relevant metrics in AdSense dashboard

Open lilybonney opened this issue 7 years ago • 19 comments

Feature Description

In the Search Console and Analytics dashboard there is a date filter:

Date Filter

However, this is not present in the AdSense dashboard screen. The "Estimated Earnings" widget doesn't need date filter, but the other two statistics on this screen would benefit from it.

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

Acceptance criteria

  • There should be a date picker on top of the AdSense module page, similar like it is on e.g. the Analytics module page.
  • The "Estimated Earnings" widget should be removed entirely.
  • The first "Performance over previous 28 days" should be updated:
    • Title should change to "Performance over the last 28 days" (suffix should be based on current date range like in e.g. Analytics module page), for consistency with date picker and similar headings in e.g. Analytics module page.
    • There should be two additional columns in the widget:
      • The "Earnings" value for the current period should be the first column, before "Page RPM".
      • The "Page CTR" value for the current period should be the fourth column, after "Impressions" (the AdSense metric is called PAGE_VIEWS_CTR).
    • The values (i.e. the respective queries) should be based on the currently selected date range.
    • "Advanced Settings" should change to "See full stats in AdSense".
  • The second "Performance over previous 28 days" should be updated:
    • Title should change to "Performance by page over the last 28 days" (suffix should be based on current date range like in e.g. Analytics module page).
    • The values (i.e. the respective queries) should be based on the currently selected date range.
    • "Advanced Settings" should change to "See full stats in AdSense".

Implementation Brief

  • In assets/js/modules/adsense/index.legacy.js add the googlesitekit.showDateRangeSelector-${ slug } to return true to display the DateRangeSelector component in the AdSense page.
  • Wrap the AdSenseDashboardWidget with the withSelect HOC from Data that adds the dateRange prop using the getDateRange selector from core/user
  • import the getCurrentDateRange to use for displaying the date range in other components.
  • Remove the <Layout /> component from AdSenseDashboardWidget component that represents the Estimated earnings section.
  • Update the titles for each remaining Layout components to reflect date range as per the AC.
  • Refactor the AdSensePerformanceWidget to be a functional component.
  • Refactor the withData settings in AdSensePerformanceWidget to use the getReport selector from the modules/adsense datastore passing metrics: [ 'EARNINGS', 'PAGE_VIEWS_RPM', 'IMPRESSIONS', 'PAGE_VIEWS_CTR' ], to retrieve the PAGE_VIEWS_CTR data point
  • Add the new Earnings and Page CTR columns to the AdSensePerformanceWidget
  • Ensure that all values are being updated to reflect the selected date range.
  • Update all Advanced Settings text to See fill stats in AdSense
  • Finish and merge #1971

QA Brief

  • The date picker should be available on the AdSense dashboard page
  • The Estimated Earnings module should no longer exist.
  • The title of the first modules should read Performance over the last XX days where the XX is the currently selected date range.
  • The first module should have 4 sections:
    • Earnings, Page RPM, Impressions, and Page CTA
    • They should all update their values based on changes to the date range selector.
  • The title of the second modules should read Performance by page over the last XX days where the XX is the currently selected date range.
  • The data for the second module should update when the date range is changed.
  • External link for both modules should say See full stats in AdSense with the external link icon.

Changelog entry

  • Make AdSense module page UI more consistent with other modules, allowing to filter information by date instead of showing at-a-glance information for different date periods.

lilybonney avatar Jul 21 '19 18:07 lilybonney

Hi Lily, As you said, could we add a date picker to the 2nd & 3rd charts in the AdSense dashboard screen. Best to match the way it is implemented in Search Console, Analytics & other screens. The titles of the 2nd & 3rd screens will need to change as they currently include "over previous 28 days". sC99FV47RZV The date picker should include "today" as well as the same options as the other products: 7, 14, 28, 90 days.

OisinOConnor avatar Feb 20 '20 14:02 OisinOConnor

Hey @OisinOConnor, is there a more descriptive name you'd suggest for the section called "Other metrics"?

marrrmarrr avatar Mar 16 '20 19:03 marrrmarrr

@OisinOConnor Could you provide an update on this?

felixarntz avatar May 04 '20 16:05 felixarntz

Possibly:

  • Performance metrics
  • Site performance

OisinOConnor avatar May 28 '20 12:05 OisinOConnor

@marrrmarrr Updated ACs based on our conversation earlier. I also included a note to change the "Advanced Settings" text to "See full stats in AdSense", which makes more sense here and is in line with what we display in the same place for Analytics.

I opened #1921 for the separate follow-up task to introduce a graph for these metrics over the period to this screen like we said earlier.

felixarntz avatar Aug 17 '20 18:08 felixarntz

Does this mean all you guys and these notices...that you are working on my site?

-----Original Message----- From: Felix Arntz [email protected] To: google/site-kit-wp [email protected] Cc: Subscribed [email protected] Sent: Mon, Aug 17, 2020 11:12 am Subject: Re: [google/site-kit-wp] Add date filters for relevant metrics in AdSense dashboard (#317)

@marrrmarrr Updated ACs based on our conversation earlier. I also included a note to change the "Advanced Settings" text to "See full stats in AdSense", which makes more sense here and is in line with what we display in the same place for Analytics.I opened #1921 for the separate follow-up task to introduce a graph for these metrics over the period to this screen like we said earlier.— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

cheryl-cherylfischer avatar Aug 17 '20 19:08 cheryl-cherylfischer

@ryanwelcher IB mostly looks good, just one thing:

Add PAGE_VIEWS_CTR to the array of metrics in includes/Modules/AdSense.php

These metrics being set in PHP is now somewhat legacy, that datapoint as of #1776 supports requesting specific metrics from the client. So rather than altering that server-side default (which only exists for backward-compatibility), let's modify the client-side request to include a metrics field with all four metrics.

felixarntz avatar Aug 29 '20 00:08 felixarntz

IB ✅

felixarntz avatar Aug 31 '20 23:08 felixarntz

Tested

Installed, activated and setup latest develop SK. Activated Adsense module and checked the following:

  • Confirmed estimated earnings is no longer on the Adsense Dashboard
  • 4 items are displayed (Earnings, Page RPM, Impressions, and Page CTR) in the performance box
  • 'Performance over the last XX days' title exists and functions properly
  • External 'See full stats in AdSense' link functions properly
  • Confirmed mobile, and smaller size window views function properly

Items to note: The green check for 'Adsense is connected' is not clearing itself Site Kit by Google AdSense ‹ Hellogoodbye — WordPress

When there's no ad impressions for 7 days, the date filter becomes broken unless the user refreshes the page: Site Kit by Google AdSense ‹ Hellogoodbye — WordPress (1)

Sending back to @ryanwelcher for adjustments

cole10up avatar Oct 19 '20 05:10 cole10up

Items to note: The green check for 'Adsense is connected' is not clearing itself

@cole10up I believe this is expected behavior.

ryanwelcher avatar Oct 19 '20 15:10 ryanwelcher

@cole10up @felixarntz - @aaemnnosttv and I were able to reproduce the zero data issue and it's related to withData. @aaemnnosttv is going to open a ticket to address it separately.

ryanwelcher avatar Oct 21 '20 14:10 ryanwelcher

It turns out the issue was local to the AdSenseDashboardWidget component which tracks zeroData separately from withData. It's been fixed in #2224 👍

aaemnnosttv avatar Oct 21 '20 15:10 aaemnnosttv

@cole10up ready for another pass 👍

aaemnnosttv avatar Oct 21 '20 15:10 aaemnnosttv

Retested

Was able to confirm 0 data doesn't corrupt the date sort.

Site Kit by Google AdSense ‹ Hellogoodbye — WordPress (2)

Noticed the Page Performance box, when loading shows multiple rows prior to finishing the load. Not a show stopper but something to note.

Passed QA ✅

cole10up avatar Oct 21 '20 16:10 cole10up

During smoke testing with the latest release I am seeing the following

On hellogoodbye.today when on the Adsense dashboard, when I flip from 28 days to 90 days, there is data according to the full stats in Adsense but I'm seeing what is looking like actual data available for a millisecond then the 'No ad impressions yet' message is shown. See below. Flipping to 90 days you see a quick flash of the actual metrics

Site Kit by Google AdSense ‹ Hellogoodbye — WordPress (3)

Checking Adsense statistics, I see impressions past 28 days: image

Sending back to Execution for adjustments as 90 days should display data when available.

cole10up avatar Oct 23 '20 18:10 cole10up

@ryanwelcher @aaemnnosttv Let's try to find the reason for this one early on Monday. It's not a highly critical problem I think, but it appears to be a regression from this one, so it should be addressed in a timely manner.

Depending on whether the fix is simple enough, we can squeeze it into this release - otherwise let's open a follow-up issue and mark it for the 1.20.0 release.

felixarntz avatar Oct 23 '20 18:10 felixarntz

@felixarntz @ryanwelcher It has to do with a change to the isDataZeroAdSense function; will open a PR against master for this now.

aaemnnosttv avatar Oct 26 '20 09:10 aaemnnosttv

@felixarntz The PR is opened for inclusion in the release now. The problem @cole10up found was that the component would render a zero data state if the previous range had no data.

Using Cole's data which is able to reproduce the behavior above, I can now see the 90 day range (note the relative change indicators and values are not shown due to lack of data).

image

aaemnnosttv avatar Oct 26 '20 10:10 aaemnnosttv

Retested

Installed the latest zip, activated and setup SK. Activated Adsense and confirmed the fix: Site Kit by Google AdSense ‹ Hellogoodbye — WordPress (4)

Passed QA ✅

cole10up avatar Oct 26 '20 17:10 cole10up