Skip to content

Send the fdh_opened_* survey triggers from the hub #14145

Open

Description

@techanvil

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_interaction survey trigger.
  • The plugin sends the fdh_opened_with_interaction survey 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_TTL constant, set to 2147483647 seconds (2 ** 31 - 1, the largest signed 32-bit integer, so 32-bit PHP can store it), next to GLOBAL_SURVEYS_TIMEOUT_SLUG in assets/js/googlesitekit/datastore/user/constants.js. Send the fdh_not_opened survey 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 to FEATURE_HUB_FEEDBACK_NAMESPACE, add constants for the fdh_opened_no_interaction and fdh_opened_with_interaction trigger IDs.
  • Send both triggers with ttl: SURVEY_TRIGGER_MAX_TTL, so that each one is sent at most once per user. triggerSurvey already 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_interaction trigger when the hub opens, by rendering SurveyViewTrigger in FeatureDiscoveryApp with the trigger ID and ttl={ SURVEY_TRIGGER_MAX_TTL }.
  • Send the fdh_opened_with_interaction trigger by calling CORE_USER's triggerSurvey( triggerID, { ttl: SURVEY_TRIGGER_MAX_TTL } ), without waiting for it, at each interaction the acceptance criteria list:
    • Read more: onClickReadMore in FeatureCard.
    • Setup button: onClick in FeatureCTA, which covers the card and the detail panel (PanelFooter), and handleClick in VisitorGroupsFeatureSetup, which renders its own setup button on the card. Send it next to the existing getFeatureSetupSurveyTriggerID() call in both places.
    • Category filter chip: onToggleCategory in AllServicesTab, only when a category is added to selectedCategories. Removing a category and clicking the All services chip (categorySlug === null) do not send it.
    • Relevance vote: onVote in FeatureRelevancyFeedback.
    • "What's new?" dismissal: onSelectFeedback in FeatureCard, only when value is set. The Just hide this suggestion option (FEATURE_RELEVANCY_REASONS.JUST_HIDE) has no value, so it does not send the trigger.

Test Coverage

  • Update the tests for each component changed above, so that they check that the interaction sends fdh_opened_with_interaction with ttl set to SURVEY_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) and FeatureRelevancyFeedback.test.tsx.
  • Update FeatureDiscoveryApp.test.tsx to check that opening the hub sends fdh_opened_no_interaction with ttl set to SURVEY_TRIGGER_MAX_TTL, and that it is not sent when the survey-timeouts response already contains that trigger ID.
  • Fix any existing failing tests.

QA Brief

  1. Ensure featureDiscoveryHub feature flag is enabled in tester plugin and set up Site Kit as an administrator, with Analytics connected.
  2. Open the browser's developer tools on the Network tab and filter by survey-trigger.
  3. Go to Site Kit > Add features. One survey-trigger request should be sent, with this payload: {"data":{"triggerID":"fdh_opened_no_interaction","ttl":2147483647}}.
  4. Reload the page and open Add features again. No new request for fdh_opened_no_interaction should be sent.
  5. Click Read more on any card. One survey-trigger request 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 for fdh_opened_with_interaction should be sent, also after reloading the page.
  6. 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_interaction is sent again; that is expected.
  7. Each of these, done first, should send fdh_opened_with_interaction with ttl 2147483647:
    • 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-trigger URL 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.
  8. 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

  1. self-assigned this
    on Nov 11, 2026
  2. added
    P0
    Type: Enhancement
    Team M
    on Nov 11, 2026
  3. removed their assignment
    on Nov 11, 2026
  4. added
    Next Up
    on Nov 12, 2026
  5. self-assigned this
    on Nov 12, 2026
  6. techanvil commented on Nov 12, 2026

    @techanvil
    CollaboratorAuthor

    Hi @ankitrox, thanks for the IB. My comment on #14144 applies here too:

    Rather than using a dismissed item, let's set the survey TTL to a maximum safe value - 2,147,483,647 seconds (2³¹ - 1, the highest signed 32 bit integer, to support 32 bit PHP).

    This is about 68 years, which is good enough for "once per user".

    Please define it in a constant: SURVEY_TRIGGER_MAX_TTL in datastore/user/constants.js. We'll use the same constant in #14145.

    Please amend the IB to take this approach. We can define the constant in either issue, to help move them forward in parallel.

  7. ankitrox commented on Nov 13, 2026

    @ankitrox
    Collaborator

    Thank you @techanvil for reviewing the IB. I've updated the IB to use survey TTL instead of using dismissed item.

  8. removed their assignment
    on Nov 13, 2026
  9. 6 remaining items

  10. assigned and unassigned on Nov 17, 2026
  11. assigned and unassigned on Nov 18, 2026
  12. removed their assignment
    on Nov 19, 2026
  13. removed their assignment
    on Nov 24, 2026
  14. ncoetzer commented on Nov 24, 2026

    @ncoetzer
    Collaborator

    Note for QA: Per the feedback/discussion on #14144, triggers may be sent again on reload. This will be fixed in #14258.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Team MType: Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions