-
Notifications
You must be signed in to change notification settings - Fork 295
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
Trigger remote survey about Idea Hub usage #4052
Comments
@felixarntz I don't think we need to introduce a REST endpoint for this. I think it would be simpler to manage the count in client side state and just initialize the value on page load from what the server provides. Even if there is some duplication, it's just a counter, so there isn't really much business logic to worry about getting out of sync. We can just annotate both parts to ensure the other is updated if/when it ever needs to be. |
IB ✅ |
@aaemnnosttv That sounds good to me, I was also thinking something along those lines - the REST API was just an alternate solution. |
@eugene-manuilov I've added a point to the ACs to include here the timeout increase we've discussed. |
@felixarntz @aaemnnosttv I had to recreate the PR for this ticket because the original PR contains unwanted changes from the develop branch. Please, review #4100 now. |
@eugene-manuilov would you please add a QAB? |
@felixarntz could you please add instructions on how the new survey should work? Which questions should be shown based on user answers? |
@eugene-manuilov @wpdarren I'm not gonna go into detail on which answer choices etc there should be, you can assume those are correct. High-level it should be as follows:
You should never see both the question about whether you're satisfied and the question whether you're dissatisfied in the same session, i.e. it has to be ensured that it's the above 2 questions that show, never all 3 (that's the part mostly related to #4051). In order to trigger the notification, in addition to the plugin-side requirements, you have to be on version 1.42.0 and you have to have activated Idea Hub in the site at least 48 hours ago. Also as soon as you complete or close the survey, you won't be able to trigger it again on the same site and same Google account. If needed, coordinate with me to reset that. |
QA Update:
|
@wpdarren I've cleared the storage so you should now be able to retrigger the notification.
We don't have any designs, all the UI components used here were already QAd before when they were originally introduced, so it's not necessary to review the exact design as part of this. I think once you've confirmed the flow works as well for replying something between 1-3, this should be good to go. |
QA Update: ✅All good. I used a site that was created and set up with Idea hub on Monday, and after triggering six actions as per the AC, the survey appeared 🎉 The first question was a rating, and I chose 5, and then the next question was multiple choice. I selected two options and clicked on next. The final message appeared thanking me for my feedback. I then chose 2 in the rating and a new set of multiple choice questions appeared based on my rating. |
A new remote survey for Idea Hub should be supported, specifically on the plugin side this means that the triggering logic needs to be added. Also the new survey relies on #4051 - that is only a blocker for full testing though, it shouldn't block the implementation of this issue.
The requirements on the Site Kit Service side to trigger this survey are the following:
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
interact_idea_hub
should be issued. If a survey is returned it should be displayed as usual./survey/trigger/
and/notifications/
requests to the proxy should be increased to 15 seconds.Implementation Brief
The API infrastructure is currently being built. Depending on how quickly this gets implemented, the Site Kit Service part may not be ready yet. Please coordinate testing with @felixarntz.
PHP
Google\Site_Kit\Modules\Idea_Hub\Idea_Interaction_Count
class which extendsUser_Setting
googlesitekit_idea-hub_interaction_count
integer
0
increment
which simply takes the current value, increases it by1
and saves itIdea_Hub::__construct
to initializeIdea_Interaction_Count
to a protectedinteractionCount
property similar to how is currently done with post name/text/topic classesIdea_Hub::setup_assets
to extend the_googlesitekitIdeaHub
global with a newinteractionCount
property, which is defined by the current integer value ofIdea_Interaction_Count
Idea_Hub::parse_data_response
method to callIdea_Interaction_Count::increment
for the following datapoints:POST:create-idea-draft-post
POST:update-idea-state
JS
interactions
store partial to the Idea Hub data storeinitialState
will only need a single propertyinteractionCount
which should be initialized from the property by the same name on the_googlesitekitIdeaHub
globalselectors.getInteractionCount
- returns the property from stateactions.incrementInteractions
- returns a simple action which when handled in the reducer increments the interaction count by 1incrementInteractions()
after the respective interaction action has been done, and only if that action did not result in an errorupdateIdeaState
inassets/js/modules/idea-hub/datastore/idea-state.js
createIdeaDraftPost
inassets/js/modules/idea-hub/datastore/draft-ideas.js
useIdeaInteractionTriggerEffect
hook inassets/js/modules/idea-hub/hooks
getInteractionCount
useEffect
which runs when the interaction count updates (not on initial run/mount – ie cleanup only)triggerSurvey
with thetriggerID
as defined in the ACsDashboardIdeasWidget
to use the newuseIdeaInteractionTriggerEffect
Test Coverage
Idea_Interaction_Count
classQA Brief
To test this ticket you need to use a release candidate version for
1.42.0
or higher.https://www.elasticpress.io/
using the develop settings pluginChangelog entry
The text was updated successfully, but these errors were encountered: