site-kit-wp icon indicating copy to clipboard operation
site-kit-wp copied to clipboard

Implement TwG custom GA events for customization

Open felixarntz opened this issue 3 years ago • 2 comments

GA events for the second part of the TwG setup (customization) and similar settings interactions should be implemented.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

For all of the following GA events, the event category should be {viewContext}_thank-with-google.

  • When changing the TwG button/CTA type, a custom GA event should be sent:
    • Event name: change_cta_type
    • Event label: either overlay or fixed, based on what the user selected
  • When changing the TwG button/CTA prominence (in case of overlay), a custom GA event should be sent:
    • Event name: change_cta_prominence
    • Event label: either low or high, based on what the user selected
  • When changing the TwG button/CTA position (in case of fixed), a custom GA event should be sent:
    • Event name: change_cta_position
    • Event label: either auto, above-content, below-content, or below-first-paragraph, based on what the user selected
  • When changing the TwG color theme, a custom GA event should be sent:
    • Event name: change_color_theme
    • Event label: the color slug/string identifier, based on what the user selected
  • When changing the TwG button/CTA post types, a custom GA event should be sent:
    • Event name: change_cta_post_types
    • Event label: comma separated list of post type slugs/string identifiers, based on what the user selected
  • All of the above events should be fired for the setup customization step and in settings. The only difference there would be the event category (which would be handled automatically via the viewContext variable).

Implementation Brief

action: change_cta_type

  • Update onChange handler to TypeRadio in CTAPlacement to call trackEvent with the attributes defined in the AC

action: change_cta_prominence

  • Update onChange handler within ProminenceRadio to call trackEvent with the attributes defined in the AC

action: change_cta_position

  • Update onChange handler within PositionRadio to call trackEvent with the attributes defined in the AC

action: change_color_theme

  • Update onChange handler within ColorRadio to call trackEvent with the attributes defined in the AC

action: change_cta_post_types

  • Update toggleChip handler within PostTypesSelect to call trackEvent with the attributes defined in the AC

Test Coverage

  • No changes necessary

QA Brief

  • Ensure that the twgModule feature flag is enabled.
  • Ensure that Tracking is enabled in Site Kit Admin Settings.
  • While setting up Thank with Google, reach the step which lets you customise its appearance.
  • Using a browser extension like this, verify that all the custom GA events mentioned in the ACs are triggered with appropriate attributes.
  • After setup, go to Settings->Connected Services and edit the Thank with Google module.
  • Verify that the events are also triggered during updating the settings.

Changelog entry

  • Measure interactions when changing Thank with Google configuration.

felixarntz avatar Oct 17 '22 16:10 felixarntz

QA Update: ⚠️

@nfmohit. An observation: If you use all or any of the defaults when setting up TwG, the appropriate GA events are not triggered. They only get triggered when you click on the particular individual settings. Is this expected? I suspect not.

Verified:

The context was moduleSetup_thank-with-google

  • When changing the TwG button/CTA type, a custom GA event is sent:

    • Event name: change_cta_type
    • Event label: either overlay or fixed.
  • When changing the TwG button/CTA prominence (in case of overlay), a custom GA event is sent:

    • Event name: change_cta_prominence
    • Event label: either low or high.
  • When changing the TwG button/CTA position (in case of fixed), a custom GA event is sent:

    • Event name: change_cta_position
    • Event label: either auto, above-content, below-content, or below-first-paragraph.
  • When changing the TwG color theme, a custom GA event is sent:

    • Event name: change_color_theme
    • Event label: the color slug/string identifier.
  • When changing the TwG button/CTA post types, a custom GA event should be sent:

    • Event name: change_cta_post_types
    • Event label: comma separated list of post type slugs/string identifiers.

I tested all of the events above in the settings but the context was settings_thank-with-google

Screenshots

image image image image image image image image image

wpdarren avatar Oct 19 '22 10:10 wpdarren

From the ACs here, these should only fire on change, presumably because otherwise it would be the defaults for every user. I assume the intent of the events here is to capture when a user changes to non-default settings (and/or when they change back to the defaults from a non-default setting).

So this is working as intended I think, but worth being checked by @felixarntz or @aaemnnosttv during approval.

I think that's QA ✅ for now 👍🏻

tofumatt avatar Oct 19 '22 12:10 tofumatt