Closed felixarntz closed 3 years ago
@ryanwelcher The IB is on the right track, it's missing some arguments though which are necessary to pass to getDateRangeDates
in order to maintain the current behavior (see how the Analytics
PHP class calls parse_date_range
for comparison):
offsetDays
needs to be passed as 1
.compare
is passed as true
, weekdayAlign
also needs to be passed as true
.The only other issue is that for assets/js/modules/analytics/components/dashboard/DashboardUniqueVisitorsWidget.js
the described changes are slightly inaccurate, as there are two different requests made there which require different modifications.
IB Updated.
@ryanwelcher
- In
assets/js/modules/analytics/components/dashboard/DashboardUniqueVisitorsWidget.js
- Remove
dateRange
from thecommonArgs
array.- Spread the results of
select( CORE_USER ).getDateRangeDates({ offsetDays: 1, compare: true, weekdayAlign:true })
into thecommonArgs
array.
This is still not fully correct: When you look at the current logic, you'll see that sparklineArgs
uses just the regular dateRange
, and only args
uses dateRange
and multiDateRange
. In other words, I think commonArgs
should now only be used for the (potentially existing) url
argument. Then, we need to spread the results from two different getDateRangeDates
calls into sparklineArgs
and args
respectively - one not passing compare: true
, the other passing it.
@felixarntz this one is ready for another pass. I bumped the estimate a little to allow for more time in QA to make sure the requests are resulting in the same data on the front.
IB ✅
@benbowler Leaving a note here that we'll need to also make Storybook changes here so that the stories for those Analytics widgets still pass after the production code changes.
Added QA Brief and marked ready for code review.
@aaemnnosttv @cole10up I'm sorry, but really struggling with this ticket. Feel like I am wasting time going through the console within XHR, trying to look for API data. Please could you give me steps to find what I need to check and compare.
Here's what I am seeing in console.
@wpdarren - Checking on my end, I'm in the same boat. Looking for a bit more context on this one as well. I'm seeing the widget items when I search through the API console. But unsure what specifically I should be seeing.
@benbowler @aaemnnosttv I have two observations:
Verified:
DashboardBounceRateWidget
, I see this widget on the details page for a particular URL:@benbowler: Can you take a look at @wpdarren's second point from the comment above?
Hey @wpdarren , to answer your questions:
DashboardBounceRateWidget I am unable to find the widget on the SK dashboard. This is for current or legacy. I can see them on the individual storyboard but not on my test site with development build. Should it be appearing? I can ee the bounce rate is actually on the Analytics page.
The bounce rate widget is exclusively used on the stats breakdown for individual pages, not on any general dashboards. To see a stats breakdown for an individual page you can do the following:
That should take you to the breakdown of stats for the features page which includes the Bounce Rate widget.
Under Search funnel for Unique Visitors. The top widget title is 'Unique Visitors' but the bottom widget is 'Unique Visitors from Search' should these be the same? Screenshots: Top and Bottom
The widget entitled 'Unique Visitors from Search' is a separate legacy widget called LegacyAnalyticsDashboardWidgetTopLevel
, the DashboardUniqueVisitorsWidget
has the title
Unique Visitors
so this is the one to check between the release and new version:
@wpdarren As an aside I find the Chrome React developer tools extension useful for tracking down components I should be working on:
Verified:
The Analytics
dashboard
andpageDashboard
widgets should be migrated to passstartDate
andendDate
instead ofdateRange
(as well ascompareStartDate
andcompareEndDate
where applicable) with their API requests.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
startDate
andendDate
(using thecore/user
getDateRangeDates
selector) instead ofdateRange
to theirgetReport
calls:DashboardAllTrafficWidget
DashboardPopularPagesWidget
startDate
,endDate
,compareStartDate
, andcompareEndDate
(using thecore/user
getDateRangeDates
selector) instead ofdateRange
andmultiDateRange
to theirgetReport
calls:DashboardBounceRateWidget
DashboardGoalsWidget
DashboardUniqueVisitorsWidget
dateRange
(and related) parameter (e.g. depending on theoffsetDays
value passed togetDateRangeDates
).Implementation Brief
Update args passed to
getReport
selectorDashboardAllTrafficWidget
,DashboardPopularPagesWidget
getDateRangeDates
asdateRangeDates
offsetDays: 1
args
dateRange
dateRangeDates
DashboardBounceRateWidget
,DashboardGoalsWidget
getDateRangeDates
asdateRangeDates
offsetDays: 1
compare: true
weekdayAlign: true
args
dateRange
dateRangeDates
DashboardUniqueVisitorsWidget
commonArgs
dateRange
url
unconditionally (only has effect if not empty)getDateRangeDates
assparkRangeDates
offsetDays: 1
sparklineArgs
sparkRangeDates
getDateRangeDates
asdateRangeDates
offsetDays: 1
compare: true
weekdayAlign: true
args
dateRangeDates
Test Coverage
Visual Regression Changes
QA Brief
DashboardAllTrafficWidget
DashboardPopularPagesWidget
DashboardBounceRateWidget
DashboardGoalsWidget
DashboardUniqueVisitorsWidget
Changelog entry