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

Incorrect dimension filter applied in various components that uses `adSourceName` dimension

Open kuasha420 opened this issue 1 year ago • 1 comments

Bug Description

In the following components, the dimensionFilters is applied in the report args incorrectly, resulting them to be no-op.

  • AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification
  • DashboardTopEarningPagesWidgetGA4
  • TopEarningContentWidget

The dimension filters should be placed inside the dimensionFilters property in the report args object. Also for a little bit of simplification, the logic can be rewritten to be the following shorthand syntax, since the filter is a exact match string filter covered by Google\Site_Kit\Modules\Analytics_4\Report\Request::parse_dimension_filter:

		dimensionFilters: {
			adSourceName: `Google AdSense account (${ adSenseAccountID })`,
		},

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

Acceptance criteria

  • Dimension filter for the Analytics reports in AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification, DashboardTopEarningPagesWidgetGA4 and TopEarningContentWidget should be applied correctly.

Implementation Brief

  • [ ] Update the report args in assets/js/components/OverlayNotification/AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification.js, assets/js/modules/adsense/components/dashboard/DashboardTopEarningPagesWidgetGA4.js and assets/js/modules/adsense/components/widgets/TopEarningContentWidget.js file:
    • [ ] Remove the filter property from the report options.
    • [ ] Add the dimensionFilters object to the report option, and add the adSourceName property with Google AdSense account (${ adSenseAccountID }) value inside the dimensionFilters object.

Test Coverage

  • Update all the relevant test and stories for the aforementioned components.

QA Brief

Changelog entry

kuasha420 avatar May 06 '24 06:05 kuasha420

IB ✅

tofumatt avatar May 06 '24 13:05 tofumatt

QA Update ✅

  • Tested on dev environment.
  • Verified DashboardTopEarningPagesWidgetGA4 and TopEarningContentWidget on main dashboard.
  • Verified DashboardTopEarningPagesWidgetGA4 and TopEarningContentWidget on entity dashboard.
  • Verified both widgets are getting render without any error.
  • Verified both widgets content is same on latest and dev environment.
  • Verified all links under both widgets.

Develop :

Top Earning pages widget

image

Top Earning Content widget

image

Latest :

Top Earning pages widget

image

Top Earning Content widget

image

View Only Dash board

image

image

mohitwp avatar May 29 '24 12:05 mohitwp

@10upsimon, @tofumatt, as discussed on Slack, the changes in the associated PR have caused VRT failures. Therefore, I’m moving this ticket back in execution to update the VRT images accordingly.

hussain-t avatar May 30 '24 09:05 hussain-t

As this was previously in Approval and the only change in the followup was to update the VRT images, and with CI confirmed passing for the update, I'm moving this back to Approval.

techanvil avatar May 30 '24 10:05 techanvil