-
Notifications
You must be signed in to change notification settings - Fork 284
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
Add Audience Reset class to reset Audience settings across all users on Analytics property change. #9328
Add Audience Reset class to reset Audience settings across all users on Analytics property change. #9328
Conversation
Build files for 2479dd6 have been deleted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work here, @benbowler !
- I've pointed out an issue with
configuredAudiences
not being set to the default value, causing some unexpected side-effects, such as the setup CTA banner not appearing. We should probably consider deleting the option entirely instead. - I've also pointed out some minor observations.
- Could we expand the QAB especially in regards to the part which references dismissed prompts or items? Instead, I think we should specify what the QA specialist should see visually in their UI, e.g. see the setup CTA banner, the success notification, etc.
- Apart from the above, this is a very nitpicky observation, but when I took a look at the code comments added in this PR (which are very helpful), I noticed a usage of inconsistent casing of words, for example
Audience Settings
instead ofaudience settings
, etc. This is very nitpicky, but if we have capacity, could we review these and update for consistency? Ideally, any references to class names (e.g.Dismissed_Prompts
) should appear as the class name itself, and any reference to feature names (e.g.Audience Segmentation
) can be capitalised. Otherwise, everything else can just use natural casing.
Please let me know if you have any questions, thank you!
tests/phpunit/integration/Modules/Analytics_4/Reset_AudiencesTest.php
Outdated
Show resolved
Hide resolved
tests/phpunit/integration/Modules/Analytics_4/Reset_AudiencesTest.php
Outdated
Show resolved
Hide resolved
tests/phpunit/integration/Modules/Analytics_4/Reset_AudiencesTest.php
Outdated
Show resolved
Hide resolved
tests/phpunit/integration/Modules/Analytics_4/Reset_AudiencesTest.php
Outdated
Show resolved
Hide resolved
…hanging-analytics-property-name-AS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for making the updates, @benbowler. I've left one last comment. Please let me know what you think, thanks!
Co-authored-by: Nahid Ferdous Mohit <nahid.mohit@10up.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for making the update, @benbowler.
On my final review, I noticed quite a significant issue that I've pointed out below. As we are in sort of a time constraint here, I hope you wouldn't mind if I went ahead and made the changes myself.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @benbowler !
$new_value['availableCustomDimensions'] = null; | ||
$new_value['availableAudiences'] = null; | ||
$new_value['audienceSegmentationSetupCompletedBy'] = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @nfmohit, thanks for applying this fix.
It does strike me that we could have taken an alternative route of overriding the Analytics_4::Settings::merge()
method, to allow null
to be merged for these properties. This would allow us to use merge()
as we want to and keep the audience-related reset logic encapsulated within Reset_Audiences
as originally intended.
Could I please as you to create a followup issue as an Audience Segmentation P2 where we can explore this further?
I'll go ahead and merge this for now. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely, I've created #9388 as a follow-up, thanks Tom!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @benbowler and @nfmohit.
Summary
Addresses issue:
Relevant technical choices
Overall my implementation matched the IB with some small changes such as, moving all resets within the
reset_audience_data
function rather than leaving resets of the settings inregister
. I also created a newreset
method onAudience_Settings
to allow for full reset of the settings bypassing some sanitisation that prevented themerge
method from being able to fully reset the data.PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist