-
Notifications
You must be signed in to change notification settings - Fork 279
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
Implement the secondary user setup #8130
Comments
Note that we have some UX considerations to resolve before this can move forward to AC, as per this thread in Figma. |
The UX considerations have been resolved, and I've moved this forward to AC. |
Hi @ankitrox, thanks for the IB. Here are a few points:
|
Thanks for the update to the IB @ankitrox. A few more comments:
|
@techanvil Thank you for reviewing the IB.
I think this is exactly what we will be doing in #8155 . We will split the
IMO, this is a great idea and I think this is the correct way to do it, but the only question is we will need some way of passing the I am moving this to IBR for your review by keeping the error handling component inline as of now. Thanks again! |
Hi @ankitrox, thanks for the IB update. A few more points:
|
Hi @techanvil , Thanks for the review.
I have updated the action to
Thanks, corrected it to
Removed this one and amended the IB (first point under "Secondary user journey flow").
Yes that's correct, we will need to add #8155 as a dependency for this issue. Added it. This is because
Removed both of these points.
I agree with this. I have raised the estimate to 19, but I still feel that this should be more than 19 if not upto 30, but we do not have any pointer for this, so keeping this as 19. As the IB for #8145 is still pending, I have mentioned in the "loading state" point that we may have to pass appropriate props to Assigning this to you for review. Thanks again! |
Thanks @ankitrox - however, the IB hasn't been updated, maybe there was an issue when you tried to save it? |
Sorry @techanvil , I think it was issue from Zenhub that it did not saved changes. I have updated it again, please let me know if you can see the updated IB. Thanks |
Thanks @ankitrox! Just one last thing from me and I think this is GTG.
Maybe I am being overly pedantic, but it feels a little wrong to be dispatching a An alternative would be to rename the action What do you think? |
@techanvil I completely understood your concern and also feel like its a valid one. I have renamed the action to Let me know your thoughts. Thanks |
Thanks @ankitrox. Let's go with IB ✅ |
Feature Description
Bootstrap the audience selection for secondary users (secondary admins and view-only users).
This involves reusing the relevant subset of logic defined for the initial setup, showing a loading state and handling errors.
This issue does not include the secondary user variants of the "no audiences" banner, these will be implemented separately via #8577.
See secondary user setup in the design doc.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
Determining if the feature has already been setup
When the primary admin sets up the feature i.e. configures the audiences, save a flag
audienceSegmentationSetupComplete
in the Analytics settingsgooglesitekit_analytics-4_settings
. Default it tofalse
inget_default
function in Analytics module.Add the setting
audienceSegmentationSetupComplete
inget_view_only_keys
in Analytics module here.Resyncing the cached audiences
Check when was the last time the audiences were synced. Note that the timestamp saved there is Unix timestamp in PHP, so it needs to be multiplied by 1000.
Timestamp is saved in the Google Analytics settings under the key
availableAudiencesLastSyncedAt
, so we can check if the current timestamp greater than the saved one by an hour or more, if it has passed, then we should re-sync the audiences usingsyncAvailableAudiences
selector.POST:sync-audiences
endpoint needs to be made shareable in order to be able to call it from the view-only dashboard.Secondary user journey flow
In
assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget.js
WidgetNull
component (Refer Implement the “no audiences” banner happy path view #8155), check if feature has already been setup (Refer above mentioned point for this) and if the current user does not have configured audiences, return the twoAudienceTile
components in loading state. (Refer Implement the loading state for the Audience Tile #8145, we may have to pass appropriate prop for loading state).Refer to the
enableAudienceGroup
action for an existing block of code that handles the initial part of the setup, to configure the audiences for the secondary user according to total users.Refactor this section of
enableAudienceGroup
action, which gets and sorts the audiences according to the total users in them. This can be extracted into a separate action, let's sayretrieveInitialAudienceSelection
.enableSecondaryUserAudienceGroup
which dispatches the extracted action and runs the other logic for the setup (retrieveInitialAudienceSelection
action).enableSecondaryUserAudienceGroup
should also perform the syncing audiences inside it. This will help us to collect the error at the single point and return{ response, error }
object from a single place which will help us in handling the errors as mentioned in below section.retrieveInitialAudienceSelection
action, if there is still a place, check ifPurchasers
audience is available and has had any users. This can be checked withgetResourceDataAvailabilityDate
selector from partial data module.configuredAudiences
.setConfiguredAudiences
action from "audience-settings" data store and save the setting usingsaveAudienceSettings
action.In
assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget.js
enableSecondaryUserAudienceGroup
.AudienceTilesWidget
component will be updated significantly after implementation of Implement the “no audiences” banner happy path view #8155, please refer IB for the same.Note: As the audiences will be synced from within
enableSecondaryUserAudienceGroup
action, those won't be re-synced when we display Audience tiles the loading states. Please refer #8145 acceptance criteria.Handling errors
enableSecondaryUserAudienceGroup
action will return an object of the form, so that we can determine if there is any error. If error occurs,AudienceSegmentationErrorWidget
should be rendered.AudienceSegmentationErrorWidget
will accept a new proponRetry
which needs to be passed toReportErrorActions
, so that it should be able to re-run the setup logic after clicking "Retry" button.Test coverage
AudienceTilesWidget
- Add the stories for the state where secondary admin is visiting for the first time.a. Loading state for tiles.
b. Error states for the tiles.
e. Single tile.
Add a new test for
AudienceSegmentationErrorWidget
to test the new proponRetry
.Add tests for
retrieveInitialAudienceSelection
action.Add tests for
enableSecondaryUserAudienceGroup
action.QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: