Skip to content

Track feature metrics for SiwG and Enhanced Conversions #11572

@jimmymadon

Description

@jimmymadon

Feature Description

In issue #11422, we added most of the new feature metrics as per the Feature Metrics document.

This issue will add two more feature metrics.


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

Acceptance criteria

  • conversion_tracking_events_enh (string[]): List of unique enhanced events of active tracking providers. The following events are considered to be enhanced for their corresponding event providers:
    • easy-digital-downloads: add_to_cart (contains currency, value, etc)
    • woocommerce: add_to_cart, purchase (multiple item and order parameters)
  • siwg_onetap (bool?): If one-tap is enabled site wide. This setting will be combined in the new SiwG 1.5 work but will be migrated without the name of the field being changed.

Implementation Brief

  • Within includes/Core/Conversion_Tracking/Conversion_Event_Providers:
    • In each of the provider classes, create a static constant that lists enhanced_conversion_events as per the AC.
  • In includes/Core/Conversion_Tracking/Conversion_Tracking.php:
    • Create a new method, which is similar to the get_supported_conversion_events() method. But use the new static constant above to check if any of the active providers have events that overlap the values in the constant. If they do, add them to a list and return that list of events.
  • In includes/Modules/Sign_In_With_Google.php:
    • Let the class implement the Provides_Feature_Metrics interface.
    • Create a get_feature_metrics() method that should return an array with the siwg_onetap field and the value should be from the corresponding oneTapEnabled setting.
    • Use the Feature_Metrics trait and call the register_feature_metrics() method in the register() method.

Test Coverage

  • Add tests for the new enhanced conversion events method.

QA Brief

  • Smoke test Plugin setup, connecting SiwG along with the one tap enabled setting and setting up Key Metrics with some conversion events from WooCommerce and EasyDigitalDownloads plugins.

QA: Eng alongside Code review

  • Delete the googlesitekitpersistent_remote_features row from the wp_options table.
  • Ensure Site Kit is running in the browser so that the admin-ajax script is running every 2 minutes.
  • Use a Proxy request inspector like Proxyman or mitmproxy to inspect outbound requests to the site-management/features endpoint.
  • Repeat the above 3 steps to verify that each of the fields mentioned in the AC are correctly added to the feature_metrics array in the request, both, before and after setting up some conversion events and setting up SiwG and enabling the 'oneTap' setting.

Changelog entry

  • Add feature metrics tracking for SiwG and Enhanced Conversions

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Medium priorityP2Low priorityQA: EngRequires specialized QA by an engineerTeam SIssues for Squad 1Type: EnhancementImprovement of an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions