Repository navigation
Open
Labels
Description
Feature Description
Send the fdh_opened_no_interaction and fdh_opened_with_interaction survey triggers from the Feature Discovery Hub ("Add features"), so the Site Kit service can survey users who opened the hub, with one survey for those who didn't interact with it and another for those who did.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- When a user opens the "Add features" page, the plugin sends the
fdh_opened_no_interactionsurvey trigger. - The plugin sends the
fdh_opened_with_interactionsurvey trigger the first time an administrator does any of these on the "Add features" page:- Clicks Read more.
- Clicks a feature's setup button, on a card or in the detail panel.
- Selects a category filter chip.
- Votes on a feature's relevance.
- Dismisses a "What's new?" card with any reason other than Just hide this suggestion.
- Each trigger is sent at most once per user.
Implementation Brief
- Add a
SURVEY_TRIGGER_MAX_TTLconstant, set to2147483647seconds (2 ** 31 - 1, the largest signed 32-bit integer, so 32-bit PHP can store it), next toGLOBAL_SURVEYS_TIMEOUT_SLUGinassets/js/googlesitekit/datastore/user/constants.js. Send thefdh_not_openedsurvey trigger from the dashboard #14144 uses the same constant, so add it here only if that issue has not already added it. - In
assets/js/googlesitekit/datastore/feature-discovery/constants.ts, next toFEATURE_HUB_FEEDBACK_NAMESPACE, add constants for thefdh_opened_no_interactionandfdh_opened_with_interactiontrigger IDs. - Send both triggers with
ttl: SURVEY_TRIGGER_MAX_TTL, so that each one is sent at most once per user.triggerSurveyalready handles the rest: it skips a trigger that has a stored timeout, and its lock skips a second call for the same trigger while the first is still running. - Send the
fdh_opened_no_interactiontrigger when the hub opens, by renderingSurveyViewTriggerinFeatureDiscoveryAppwith the trigger ID andttl={ SURVEY_TRIGGER_MAX_TTL }. - Send the
fdh_opened_with_interactiontrigger by callingCORE_USER'striggerSurvey( triggerID, { ttl: SURVEY_TRIGGER_MAX_TTL } ), without waiting for it, at each interaction the acceptance criteria list:- Read more:
onClickReadMoreinFeatureCard. - Setup button:
onClickinFeatureCTA, which covers the card and the detail panel (PanelFooter), andhandleClickinVisitorGroupsFeatureSetup, which renders its own setup button on the card. Send it next to the existinggetFeatureSetupSurveyTriggerID()call in both places. - Category filter chip:
onToggleCategoryinAllServicesTab, only when a category is added toselectedCategories. Removing a category and clicking the All services chip (categorySlug === null) do not send it. - Relevance vote:
onVoteinFeatureRelevancyFeedback. - "What's new?" dismissal:
onSelectFeedbackinFeatureCard, only whenvalueis set. The Just hide this suggestion option (FEATURE_RELEVANCY_REASONS.JUST_HIDE) has novalue, so it does not send the trigger.
- Read more:
Test Coverage
- Update the tests for each component changed above, so that they check that the interaction sends
fdh_opened_with_interactionwithttlset toSURVEY_TRIGGER_MAX_TTL:FeatureCard.test.tsx(Read more; dismissal with a reason; no trigger for Just hide this suggestion),FeatureCTA.test.tsx,VisitorGroupsFeatureSetup.test.tsx,AllServicesTab.test.tsx(selecting a category; no trigger for deselecting or All services) andFeatureRelevancyFeedback.test.tsx. - Update
FeatureDiscoveryApp.test.tsxto check that opening the hub sendsfdh_opened_no_interactionwithttlset toSURVEY_TRIGGER_MAX_TTL, and that it is not sent when thesurvey-timeoutsresponse already contains that trigger ID. - Fix any existing failing tests.
QA Brief
- Ensure
featureDiscoveryHubfeature flag is enabled in tester plugin and set up Site Kit as an administrator, with Analytics connected. - Open the browser's developer tools on the Network tab and filter by
survey-trigger. - Go to Site Kit > Add features. One
survey-triggerrequest should be sent, with this payload:{"data":{"triggerID":"fdh_opened_no_interaction","ttl":2147483647}}. - Reload the page and open Add features again. No new request for
fdh_opened_no_interactionshould be sent. - Click Read more on any card. One
survey-triggerrequest should be sent, with this payload:{"data":{"triggerID":"fdh_opened_with_interaction","ttl":2147483647}}. Close the panel, then do each interaction in step 7. No more requests forfdh_opened_with_interactionshould be sent, also after reloading the page. - Before checking each interaction in step 7 on its own, clear the sent triggers. Either use Reset Site Kit and set up again, or delete the user meta
wp_googlesitekit_survey_timeouts(the prefix follows the site's table prefix), e.g.wp user meta delete <user ID> wp_googlesitekit_survey_timeouts. Then open Add features.fdh_opened_no_interactionis sent again; that is expected. - Each of these, done first, should send
fdh_opened_with_interactionwithttl2147483647:- On All services and features, click a feature's setup button on its card. Include Learn about your visitor groups if it is listed.
- On All services and features, select a category chip, such as Know your audience.
- On What's new?, dismiss a card with the close icon and choose It's not relevant to my site goals, I'm already using another tool or Setup seems complex.
- The setup button and the thumbs up and thumbs down buttons in the detail panel. The panel only opens with Read more, which already sends the trigger. To check these on their own, block the
survey-triggerURL in the developer tools before clicking Read more. Unblock it, then click the panel's setup button or vote. A blocked request stores nothing, so the next interaction sends the trigger.
- Each of these, done first, should not send
fdh_opened_with_interaction:- Selecting and then deselecting a category chip. Only the selection sends it.
- Clicking the All services chip.
- Dismissing a What's new? card with Just hide this suggestion.
- Switching between the All services and features and What's new? tabs.
Changelog entry
- N/A.
Activity
techanvil commentedon Nov 12, 2026
Hi @ankitrox, thanks for the IB. My comment on #14144 applies here too:
Please amend the IB to take this approach. We can define the constant in either issue, to help move them forward in parallel.
ankitrox commentedon Nov 13, 2026
Thank you @techanvil for reviewing the IB. I've updated the IB to use survey TTL instead of using dismissed item.
6 remaining items
ncoetzer commentedon Nov 24, 2026
Note for QA: Per the feedback/discussion on #14144, triggers may be sent again on reload. This will be fixed in #14258.