Closed aaemnnosttv closed 11 months ago
@zutigrm Instead of dispatching triggerSurvey
, when possible, we should be using the <SurveyTrigger />
component. I made a similar mistake in approach on https://github.com/google/site-kit-wp/pull/7665/commits/6d39818de1b72ed7b84d82b1965eb6c9ac89ba1a, but I've amended the IB as the idea here is right and that way we can move to execution 🙂
IB ✅
@wpdarren @mohitwp note this should be tested on main
, thanks!
abr_setup_completed:
triggered when the ABR setup success banner is shownview_abr_setup_cta:
triggered when the ABR setup CTA widget is viewed on main dashboard or under in settings.
Feature Description
Two new survey triggers should be implemented to support additional surveys for the Ad Blocking Recovery feature.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
abr_setup_completed
: triggered when the ABR setup success banner is shownview_abr_setup_cta
: triggered when the ABR setup CTA widget is viewed (this is shown in the monetization section so it should consider whether or not it is in view as a condition)Implementation Brief
ABR setup success banner
<SurveyViewTrigger />
with trigger idabr_setup_completed
andDAY_IN_SECONDS
forttl
in https://github.com/google/site-kit-wp/blob/b80ce4ea163e041e4ae54c2b1d20bb07e369e10e/assets/js/components/notifications/AdBlockingRecoverySetupSuccessBannerNotification.jsABR setup CTA widget
<SurveyViewTrigger />
with trigger idview_abr_setup_cta
andDAY_IN_SECONDS
forttl
in https://github.com/google/site-kit-wp/blob/b80ce4ea163e041e4ae54c2b1d20bb07e369e10e/assets/js/modules/adsense/components/dashboard/AdBlockingRecoverySetupCTAWidget.js wheninView && shouldShowWidget
are true.Test Coverage
assets/js/modules/adsense/components/dashboard/AdBlockingRecoverySetupCTAWidget.test.js
andassets/js/components/notifications/AdBlockingRecoverySetupSuccessBannerNotification.test.js
to test if survey triggered, you can see example inassets/js/googlesitekit/datastore/user/user-input-settings.test.js
QA Brief
POST
request is made to/wp-json/google-site-kit/v1/core/user/data/survey-trigger
with the body:The same trigger should be invoked from the CTA shown in the AdSense settings view. Since it's the same ID as the trigger on the dashboard, only the first will be observable per-user for 1 day. To see the other trigger, try using another user on the site (or separate sites).
(Use Chrome devtools or an HTTP proxy like Proxyman to view this.)
POST
request is made to/wp-json/google-site-kit/v1/core/user/data/survey-trigger
with the body:(Use Chrome devtools or an HTTP proxy like Proxyman to view this.)
(In both instances you should see a survey appear as well, as I (@tofumatt) was able to trigger one of the surveys, though now that I've triggered them I can't get them to appear again 😅 )
Changelog entry