Open techanvil opened 3 weeks ago
Hi @ankitrox, thanks for drafting this IB. A couple of points:
refetchCustomDimensions()
action, we can simply dispatch fetchSyncAvailableCustomDimensions()
directly.useEnableAudienceGroup()
, we should dispatch it in enableAudienceGroupMain()
, around the same place and in a similar way to how we dispatch syncAvailableAudiences()
. That way we can handle an error if one is returned by the call to sync the custom dimensions.Thank you @techanvil . I've updated the IB as per your suggestions.
Thanks @ankitrox, that LGTM. I've amended the Test Coverage section as we should include test coverage for the changes similar to how we test for the audiences being synced in the action.
IB ✅
Bug Description
The
googlesitekit_post_type
custom dimension is not synced or created when Audience Segmentation is enabled from the dashboard setup CTA without refreshing the Site Kit dashboard after archiving the custom dimension. This also happens from the settings CTA if we don't refresh the page.See the related Asana task.
Steps to reproduce
googlesitekit_post_type
custom dimension is created for the connected property.googlesitekit.data.dispatch( 'modules/analytics-4' ).fetchSyncAvailableCustomDimensions()
.googlesitekit_post_type
custom dimension.Screenshots
https://github.com/user-attachments/assets/37126deb-7b0c-46e8-988d-e7cc44a3e592
Additional Context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
googlesitekit_post_type
custom dimension being created if it doesn't currently exist.googlesitekit_post_type
custom dimension should be created.Implementation Brief
[ ] In
assets/js/modules/analytics-4/datastore/audiences.js
In
enableAudienceGroupMain
action, callfetchSyncAvailableCustomDimensionsStore.actions.fetchSyncAvailableCustomDimensions
around this place: https://github.com/google/site-kit-wp/blob/9a919e78e856ee0f7625e47200bd888288955c85/assets/js/modules/analytics-4/datastore/audiences.js#L385-L392If any error is occurred, it should return it the same way like it is for the
syncAvailableAudiences
currently inenableAudienceGroupMain
so that it can be handled if error is returned by the call to sync the custom dimensions.Test Coverage
enableAudienceGroup()
action.QA Brief
googlesitekit_post_type
custom dimension is created for the connected property.googlesitekit.data.dispatch( 'modules/analytics-4' ).fetchSyncAvailableCustomDimensions()
.googlesitekit_post_type
custom dimension.googlesitekit_post_type
is created again.Changelog entry