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.25k stars 291 forks source link

Add GA event tracking for the Audiences Tiles (excluding the "Top content" metric area) #9494

Open techanvil opened 3 weeks ago

techanvil commented 3 weeks ago

Feature Description

GA events should be added to keep track of interaction with Audience Tiles (barring the "Top content" metric area which will be addressed separately).


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

Acceptance criteria

The following GA events should be tracked for the given actions. See the GA events sheet.

Event Name Category Label Trigger Condition
insufficient_permissions_error {viewContext}_audiences-tile one of "new-visitors", "returning-visitors", "publishers", "all-users", or empty Element visibility User views an insufficient permissions audience tile error
insufficient_permissions_error_request_access {viewContext}_audiences-tile one of "new-visitors", "returning-visitors", "publishers", "all-users", or empty Click User clicks "Request access" on the error
data_loading_error {viewContext}_audiences-tile one of "new-visitors", "returning-visitors", "publishers", "all-users", or empty Element visibility User views a generic audience tile error
data_loading_error_retry {viewContext}_audiences-tile one of "new-visitors", "returning-visitors", "publishers", "all-users", or empty Click User clicks "Retry" on the error
view_tile_tooltip {viewContext}_audiences-tile one of "new-visitors", "returning-visitors", "publishers", "all-users", or empty click/hover User views the tooltip for an audience tile
view_tile_partial_data_tooltip {viewContext}_audiences-tile one of "new-visitors", "returning-visitors", "publishers", "all-users", or empty click/hover User views the tooltip for a partial data badge for an audience tile
view_top_content_partial_data_tooltip {viewContext}_audiences-tile one of "new-visitors", "returning-visitors", "publishers", "all-users", or empty click/hover User views the tooltip for a partial data badge in the "Top content" area of an audience tile
view_tile_collecting_data {viewContext}_audiences-tile one of "new-visitors", "returning-visitors", "publishers", "all-users", or empty Element visibility User views the "collecting data" tile variant for an audience tile
temporarily_hide {viewContext}_audiences-tile one of "new-visitors", "returning-visitors", "publishers", "all-users", or empty Click User clicks "temporarily hide" on the tile
insufficient_permissions_error {viewContext}_audiences-all-tiles Element visibility User views the insufficient permissions full width error
insufficient_permissions_error_request_access {viewContext}_audiences-all-tiles Click User clicks "Request access" on the error
data_loading_error {viewContext}_audiences-all-tiles Element visibility User views the generic full width error
data_loading_error_retry {viewContext}_audiences-all-tiles Click User clicks "Retry" on the error

Implementation Brief

Test Coverage

QA Brief

Error events

{
  "code": 403,
  "message": "Insufficient Permissions Test Error",
  "data": {
    "status": 403,
    "reason": "insufficientPermissions"
  }
}

Tooltip events

"Collecting data" events

Changelog entry

nfmohit commented 1 week ago

IB ✅