-
Notifications
You must be signed in to change notification settings - Fork 300
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 GA tracking for RRM CTA placement settings #10456
Add GA tracking for RRM CTA placement settings #10456
Conversation
Build files for fd06cda have been deleted. |
Size Change: +385 B (+0.02%) Total Size: 2.09 MB ℹ️ View Unchanged
|
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.
Hey @nfmohit, this is looking good, with the caveat that I think we should modify the approach for tracking these events, but as mentioned in a separate comment we can address that in a followup issue.
I have left a few minor comments to address here, please take a look.
assets/js/modules/reader-revenue-manager/components/settings/SettingsForm.js
Outdated
Show resolved
Hide resolved
assets/js/modules/reader-revenue-manager/components/settings/SettingsEdit.test.js
Outdated
Show resolved
Hide resolved
assets/js/modules/reader-revenue-manager/components/settings/SettingsEdit.test.js
Outdated
Show resolved
Hide resolved
assets/js/modules/reader-revenue-manager/components/settings/SettingsEdit.test.js
Outdated
Show resolved
Hide resolved
const publicationAvailable = useSelect( ( select ) => { | ||
if ( hasModuleAccess === undefined ) { | ||
return undefined; | ||
// Track GA event when snippet mode or post types change. |
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.
This is not a great approach for tracking the events. It's hard to reuse and maintain, and it could be easy to introduce a bug here in future.
It meets the AC and IB, so considering where we are time-wise I'm not going to suggest changing it here, but we should refactor this to use an approach where the event tracking is more directly tied to the save action.
I do gather the IB initially specced tracking these event in the datastore, I think this would be fine but as @hussain-t pointed out there's no easy way to provide the view context to these events from the datastore at present. However, we do have an issue in the pipeline to create a selector for retrieving the view context.
Anyhow, as mentioned let's leave this for now, I've created a followup issue where we can address the above: #10502
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.
I agree with the above. Thank you for opening the new issue 🙇
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.
Thanks, @nfmohit. LGTM!
✅
Note that I've confirmed the failing E2E test is unrelated to the changes in this PR.
Summary
Addresses issue:
Relevant technical choices
This PR adds opt-in GA event tracking for the new Reader Revenue Manager CTA placement settings.
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