google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.23k stars 284 forks source link

Implement HaTS survey triggers for ABR #7686

Closed aaemnnosttv closed 11 months ago

aaemnnosttv commented 11 months ago

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

Implementation Brief

ABR setup success banner

ABR setup CTA widget

Test Coverage

QA Brief

{
  "data": {
    "triggerID": "view_abr_setup_cta"
  }
}

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.)

{
  "data": {
    "triggerID": "abr_setup_completed"
  }
}

(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

tofumatt commented 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 ✅

aaemnnosttv commented 11 months ago

@wpdarren @mohitwp note this should be tested on main, thanks!

mohitwp commented 11 months ago

QA Update ✅

**ABR set up complete survey on Production** https://github.com/google/site-kit-wp/assets/94359491/1b38dc96-00b8-4e89-8d1c-0347d6b18760 **AdSense set up complete survey on Staging environment** https://github.com/google/site-kit-wp/assets/94359491/9a6931b3-1db1-433c-85c4-0dda4da7e754 **ABR view CTA s on Staging environment** ![image](https://github.com/google/site-kit-wp/assets/94359491/097b291a-9324-4ba2-9389-61516e38f160) ![image](https://github.com/google/site-kit-wp/assets/94359491/268d6167-b056-4bfb-a1d9-c99472e9a985) ![image](https://github.com/google/site-kit-wp/assets/94359491/34a62657-6a9d-4906-971b-9b59e6f7ff8b) ![image](https://github.com/google/site-kit-wp/assets/94359491/99c28174-e78f-4b47-b55e-31e9443e1fa4) ![image](https://github.com/google/site-kit-wp/assets/94359491/1183dfdc-a612-4060-aebb-150774011d09) https://github.com/google/site-kit-wp/assets/94359491/9de394dd-816e-4f44-86c7-a8f27e75ed80