-
Notifications
You must be signed in to change notification settings - Fork 198
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 exit survey #3729
Add exit survey #3729
Conversation
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.
Looks good and works well!
Just when we're submitting the survey, if the usage tracking is disabled, it doesn't send. Maybe should we send it anyway? Or maybe don't show the modal in this case?
assets/admin/exit-survey/form.js
Outdated
'sensei-lms' | ||
) } | ||
</p> | ||
{ reasons.map( ExitSurveyFormItem ) } |
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.
Interesting! I have never seen this approach to map directly in the component instead of the instance. I didn't know it worked!
But while debugging, I noticed that React dev tools don't recognize the mapped components. Do you know a way to fix that? Or maybe we should map it using the component instance?
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.
Yeah, this is just a function, so it works. But updated it to component instance to make it clearer.
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 think with this change we can also remove the key={ label }
from the ExitSurveyFormItem
render, right?
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.
Yup, updated in 180ed8b
Hum, I think we also need to update some e2e tests that are failing. ;) |
Ah, sorry! Another thing I remembered only now. I think we should use the |
c487c76
to
570815f
Compare
Co-authored-by: Renatho De Carli Rosa <[email protected]>
Rebased to |
Right, sending it anyway was the plan I think. That also means though that we are sending along all the base fields for the site. What should we do here @donnapep?
|
This would be the safest thing to do from a privacy perspective. We really shouldn't submit any data that they haven't opted in to sending. |
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 tested the d44d4fa and it worked well! Just adding some comments about that.
'details' => isset( $_POST['details'] ) ? sanitize_text_field( wp_unslash( $_POST['details'] ) ) : null, | ||
]; | ||
|
||
update_option( 'sensei_exit_survey_data', $feedback ); |
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.
Now I noticed that. More for documentation purposes, what's the idea of this option?
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.
If this is a new option, we should also add it to class-sensei-data-cleaner.php
.
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 recall talking about storing this, but we can get rid of it if we don't want to. Not used for anything right now.
* @param null|int $event_timestamp When the event occurred. | ||
* | ||
* @return bool | ||
**/ |
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 see that the other functions in this file close the PHPDoc with **/
, but considering it's a new function, maybe we could add it correctly */
. WDYT?
Or we could also take the opportunity to replace all of them in this file! =)
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.
Cleaned them up in a54b8b9
* | ||
* @return bool | ||
**/ | ||
public function send_anonymous_event( $event, $properties = array(), $event_timestamp = 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.
For the normal events, sounds a little weird to me going through the send_anonymous_event
. Maybe we could call it as create_pixel
, or something like that, and also have send_anonymous_event
to be called in the save_exit_survey
. The send_anonymous_event
would also call the create_pixel
(and it wouldn't do anything else for now). Does it make sense to 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.
Changed this up in bda3c37, as the anonymous method has it's own logic now.
Could the background be made a bit darker when the modal is displayed? I think it would help the modal stand out a bit more. This event is being rejected by Tracks: Looks like we are going to need to send Also, @gkaragia will want this new event to be registered in Tracks. 🙂 |
Also had to update the event name to match the When usage tracking is enabled, we send the full event. When it's not, we send the hash of the site url as the user ID. This way it's always the same for the same site, but still anonymous. |
Event is being logged now. 🙌 With usage tracking enabled, |
Sorry about that, must have removed that logic at some point — f587121 now sends the full event if tracking is enabled. |
Something is still a wee bit off. |
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.
Approving based on Renatho's previous code review and the fact that logging is working well. 👍
Fixes #2374
Changes proposed in this Pull Request
Deactivate
on the plugins screen, open up a modal with an exit survey formTesting instructions
Deactivate
on the Sensei LMS pluginSkip Feedback
should continue with deactivating plugin--
sensei_plugin_deactivate
track event should be sent, with the selected reason and detailsScreenshot / Video