-
Notifications
You must be signed in to change notification settings - Fork 286
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
Ensure the "Top content" CTA for creating the custom dimension appears when the corresponding report error shows the custom dimension is missing #9218
Comments
Hi @benbowler, thanks for drafting this IB. A couple of points:
Lines 94 to 96 in 56feb1f
|
Hi @benbowler, thanks for updating the IB. A few more points: For the view-only context:
More fundamentally, though - I've noticed the site-kit-wp/assets/js/modules/analytics-4/hooks/useAudienceTilesReports.js Lines 322 to 329 in 119747b
site-kit-wp/assets/js/modules/analytics-4/hooks/useAudienceTilesReports.js Lines 346 to 353 in 119747b
It needs to be added as a dimension filter, like we do here, but with site-kit-wp/assets/js/modules/analytics-4/components/widgets/PopularProductsWidget.js Lines 79 to 85 in 119747b
This will be needed for this issue to be complete and testable, so we should include the fix here too. There's likely to be a number of tests that need updating as a result which we should factor into the estimate. |
I chose to use the I've increased the estimate a couple of bands because the scope has expanded slightly as we've discussed required fixes/additions to be able to work on this ticket. |
Thanks @benbowler. Using A small point, you've referred/linked to IB ✅ |
QA Update
|
Hey @kelvinballoo, maybe I should have mentioned this in the QAB, but you won't be able to test this issue with the Tester plugin configured to provide mock report data. This is because the underlying code relies on the error response returned by the real request for the "Top content" data once the custom dimension has been archived. You should be able to test this with any property which is legitimately out of the gathering data state. Please give it another try and let me know if you run into any further problems. |
QA Update ✅Hi @techanvil , thanks. Clicking on 'Update' on the admin dashboard: ✅
This is working as expected. 9218.tested.good.mov9218.tested.good.for.sharing.mov |
Feature Description
The Audience Tile's "Top content" metric area has a CTA for creating the
googlesitekit_post_type
custom dimension if it doesn't exist.However, it doesn't have logic in place to determine if the custom dimension doesn't exist when requesting the report for the metric. At present it's reliant on the list of available custom dimensions being synced somewhere, which only happens during Audience Segmentation setup, or in the Key Metrics feature.
We should ensure that, if the report for the "Top content" metric returns an error because the custom dimension doesn't exist, the list of custom dimensions is resynced so the tile will immediately know that the dimension is missing and show the CTA to create it.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
googlesitekit_post_type
present in the "Top content" metric area (already implemented via Implement the “Top content” metric handling for missing custom dimension #8153).Implementation Brief
Add Missing Custom Dimension to Top Content Report
googlesitekit_post_type
dimension filter to the top content report options:site-kit-wp/assets/js/modules/analytics-4/hooks/useAudienceTilesReports.js
Lines 322 to 329 in 119747b
site-kit-wp/assets/js/modules/analytics-4/hooks/useAudienceTilesReports.js
Lines 346 to 353 in 119747b
Authenticated User Context
assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTiles.js
(note the newuseAudienceTilesReports
custom hook merged in Handle the special case for “new visitors” and “returning visitors” to avoid the “partial data” state in the Audience Tile #8144):useEffect
withtopContentReportErrors
as a dependency.topContentReportErrors
contains any invalid custom dimension errors using the.find
prototype, and use theisInvalidCustomDimensionError
util to identify this error type.fetchSyncAvailableCustomDimensions
.isSyncingAvailableCustomDimensions
containing the value of theisFetchingSyncAvailableCustomDimensions
selector:site-kit-wp/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTilePagesMetric.js
Lines 94 to 96 in 56feb1f
isSyncingAvailableCustomDimensions
:site-kit-wp/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTiles.js
Lines 419 to 427 in 41f0bba
topContentReportErrors
andtopContentPageTitlesReportErrors
here, using theisInvalidCustomDimensionError
util, so that the Top Cities Audience Tile will be rendered if there is only an invalid custom dimension error:site-kit-wp/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTiles.js
Lines 321 to 322 in b2d47c8
View-Only Context
assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/index.js
, use thegetErrorForSelector
selector to get any errors for the top content report for the audienceResourceName of the current tile.site-kit-wp/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/index.js
Line 261 in b2d47c8
Test Coverage
QA Brief
Authenticated user
audienceSegmentation
feature flag enabled and Analytics connected to a property which is out of the "gathering data" state.googlesitekit_post_type
custom dimension in Analytics.sessionStorage.clear()
in the JS console.sync-custom-dimensions
endpoint should appear in the network devtools.View-only user
Changelog entry
googlesitekit_post_type
custom dimension appears in the main dashboard when the corresponding report error indicates the missing custom dimension.The text was updated successfully, but these errors were encountered: