Closed techanvil closed 1 month ago
@ankitrox can you add the estimate to this task? Thanks!
Thanks @ankitrox, the IB LGTM. :white_check_mark:
This is ready for CR, but as it depends on #8130 , this will be moved to CR once 8130 is merged.
Actions to take before moving to CR.
Hi @ankitrox, I've merged the PR for this issue, but the QAB could use an update so I've assigned it to you in QA to make the amendment.
It's not necessary to use the mu-plugin you've provided to test this, and it's preferable to test things using a real-world user flow where possible, unless there's an exceptional reason not to.
In this case, we can test the issue by setting up Audience Segmentation using a property we've got edit access to and then archiving the custom dimension once it's created.
The property does need to be out of the gathering data state in order to set up the feature; it's reasonable to expect we should all have a property to hand that we can use for this sort of thing, but if needs be we can create a new property and then use the Tester plugin to provide mock report data in order to get the property out of the gathering data state.
I would expect QA engineers to have numerous existing properties to hand, though, so I wouldn't think this point is necessary to include in the QAB.
Please can you update the QAB accordingly?
Thank you @techanvil .
I have updated the QAB as per your instructions. It makes sense to use the GA4 property in real time. In the previous QAB I was expecting it to be tested with oi.ie analytics account.
Thanks for your feedback.
Thanks @ankitrox! I added a point to the QAB as we need to resync the custom dimensions in order to test the scenarios.
@ankitrox can you add the steps for testing this AC point when the custom dimension exists but haven't been synced:
In the edge case where the custom dimension does exist, but the available custom dimensions haven't been synced, the "Top content" metric should also not be shown. This is because the view-only user doesn't have permission to sync the available custom dimensions.
Items tested good: ✅
When googlesitekit_post_type is archived, the 'Top Content' doesn't show on view-only dashbaord.
Thanks @kelvinballoo for testing this.
There's no need to test this edge case because this is similar to archiving the custom dimension where it will not exist in available dimensions in SK.
As view only user cannot sync the dimension, the custom dimension would not be present in SK's available dimensions.
Per latest conversion in slack, the edge case can be tested through the following steps:
await googlesitekit.data.dispatch( 'modules/analytics-4' ).setAvailableCustomDimensions([]);
googlesitekit.data.dispatch( 'modules/analytics-4' ).saveSettings();
Did as per the steps and the 'Top content metric' did not appear for the view-only user. ✅
The main use-case was also verified good: ✅
When googlesitekit_post_type is archived, the 'Top Content' doesn't show on view-only dashbaord.
Feature Description
Ensure the “Top content” metric doesn’t appear for view-only users if the required custom dimension doesn’t exist.
See dashboard sharing in the design doc.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
googlesitekit_post_type
custom dimension doesn't exist, the "Top content" metric should not be shown at all in the Audience Tiles.Implementation Brief
AudienceTile
component present inassets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTile/index.js
useViewOnly
hook.googlesitekit_post_type
is created and is available using the selector hasCustomDimensions.AudienceTilePagesMetric
component for top content if the custom dimension exists and dashboard is view only. For example:Test Coverage
Add a story for
AudienceTile
where thegooglesitekit_post_type
dimension is not present and is in view only context.Fix any other failing VR tests.
QA Brief
Make sure audience segmentation is enabled and audiences tiles are visible in tiles.
Use a GA4 property with the edit access to it. Archive the custom dimension
googlesitekit_post_type
in the GA4 property.Use the following snippet in the JS console to resync the available custom dimensions:
Login with the view only user and check the tile, you should not see the
Top content by pageviews
metric.Login with admin user and you should be able to see the
Update
button with the textclicking on update will attempt to create the custom dimension, provided that the user has necessary permission for the property in GA.
Changelog entry