New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass specific dates in AdSense deep links #2689
Comments
IB ✅ |
@johnPhillips would you please add a QA brief here? |
QA brief added, let me know if there are any questions |
QA Update: Engineer to confirm
|
@wpdarren That's correct, the The proof in the pudding is that the link should work, i.e. you see the date selection in the AdSense stats. |
QA Update: Pass ✅Verified:
For 7 days For 14 days For 28 days For 90 days |
Similar to #2286 and #2287, we should include specific dates in AdSense deep links for all new datastore-driven components (i.e. those components using
select( 'core/user' ).getDateRangeDates()
).Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
d
query parameter, such as&d=2020%2F12%2F19-2021%2F01%2F17
.Implementation Brief
/assets/js/modules/analytics/components/dashboard/AnalyticsAdSenseDashboardWidgetLayout.js
DATE_RANGE_OFFSET
should be imported from/assets/js/modules/adsense/datastore/constants.js
/assets/js/modules/adsense/util/report-date-range-args
and using newly created file,generateDateRangeArgs
which accepts the returned object from thegetDateRangeDates
selector. The object contains the following keys:startDate
endDate
generateDateRangeArgs
should return an object with the following key, d:d: `${ startDate.replace( /-/g, '/' ) }-${ endDate.replace( /-/g, '/' ) }`
{ d: '2021/01/01-2021/01/27' }
/assets/js/modules/adsense/datastore/service.js
, update thegetServiceAccountSiteURL
selector to include a parameterurlParams
(object) which will be appended to the URL returned by the selector. In thequery
constant, spread theurlParams
parameter./assets/js/modules/analytics/components/dashboard/AnalyticsAdSenseDashboardWidgetLayout.js
generateDateRangeArgs
function and pass the returned object as args to thegetServiceAccountSiteURL
selector.AdSenseDashboardWidget
component. However we need to refactor this class based component into a functional one to avoid using legacy functions./assets/js/modules/adsense/components/dashboard/AdSenseDashboardWidget.js
getModulesData
from which we get thehomepage
value. This can be refactored to use thegetServiceAccountSiteURL
like in/assets/js/modules/analytics/components/dashboard/AnalyticsAdSenseDashboardWidgetLayout.js
dateRange
via props, use thegetDateRange
from the user store, like inAnalyticsAdSenseDashboardWidgetLayout
modulesData.adsense.setupComplete
, query the modules store and use theisModuleConnected
selector to get this information. For e.gTest Coverage
generateDateRangeArgs
function.urlParams
parameter to thegetServiceAccountSiteURL
selector.Visual Regression Changes
QA Brief
https://www.google.com/adsense/new/u/0/{ACCOUNT_ID/reporting
d
parameter to reflect the selected date range, e.g.:https://www.google.com/adsense/new/u/0/{ACCOUNT_ID}/reporting?d=2021/01/12-2021/02/08&authuser={EMAIL_ADDRESS}
Changelog entry
The text was updated successfully, but these errors were encountered: