Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creation of Top traffic source driving purchases ACR KMW #9164

Closed
3 tasks
10upsimon opened this issue Aug 7, 2024 · 2 comments
Closed
3 tasks

Creation of Top traffic source driving purchases ACR KMW #9164

10upsimon opened this issue Aug 7, 2024 · 2 comments
Labels
javascript Pull requests that update Javascript code Module: Analytics Google Analytics module related issues P0 High priority Team S Issues for Squad 1 Type: Feature New feature

Comments

@10upsimon
Copy link
Collaborator

10upsimon commented Aug 7, 2024

Feature Description

One of the identified metric tiles for the ACR epic is Top traffic source driving purchases. Details of this metric tile are as follows:

  • Description: Total number of purchases for top traffic source. We will extract only the top performing one and show it in existing numeric tile template (similar to the existing “Top traffic source” KM tile)
  • Events: purchase
  • Metrics: ecommercePurchases
  • Dimension: sessionDefaultChannelGroup
  • Order: Descending
  • Purpose: Inform users of the most performing traffic source so they can take action in that direction, or adjust their content strategy/marketing efforts or get confirmation that their current strategy is growing and they should keep doing it.
  • Type: Numerical

Figma design: TBA


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

Acceptance criteria

  • A new Top traffic source driving purchases ACR widget is introduced to the existing list of widgets available within KMW
    • Said widget presents visually as per the Figma design: Top traffic source driving leads within ACR metrics section of design
    • Widget displays the percentage of ecommercePurchases metric count for the sessionDefaultChannelGroup dimension (using the 1st/top channel from the results)
    • Traffic source that generates the most purchases should be used for description and the tooltip
    • Widget will not be displayed, or shown in the selection panel list if purchase event is not present, or conversionReporting feature flag is not enabled

Implementation Brief

  • Update assets/js/googlesitekit/datastore/user/constants.js
    • Include new constant, say KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_PURCHASES, holding a string kmAnalyticsTopTrafficSourceDrivingPurchases
  • Update assets/js/components/KeyMetrics/key-metrics-widgets.js
    • Register new widget for KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_PURCHASES
    • Use "Top traffic source driving purchases" for title
    • Use "Traffic source that generates the most purchases" for description and tooltip
    • Include new property requiredConversionEventName, and assign it an array value containing purchase event name
    • In displayInList pass the helper function shouldDisplayWidgetWithConversionEvent
  • Add assets/js/modules/analytics-4/components/widgets/TopTrafficSourceDrivingPurchases.js
    • You can use assets/js/modules/analytics-4/components/widgets/TopTrafficSourceWidget.js as a starting point
    • Include showWidget const which should hold value of isKeyMetricActive or if no event is present in the inline data (the condition used in shouldDisplayWidgetWithConversionEvent helper function), so this const can be used to return WidgetNull and prevent report requests if conditions are not met. You can see example usage of this const in assets/js/modules/analytics-4/components/widgets/PopularProductsWidget.js
    • In totalPurchasesReportOptions:
      • Use ecommercePurchases metric
    • In trafficSourceReportOptions:
      • Use sessionDefaultChannelGroup for dimensions
      • Use ecommercePurchases metric
  • Update assets/js/modules/analytics-4/index.js to include new widget registration

Test Coverage

  • Add stories for the new widget

QA Brief

  • Setup Site Kit with Analytics module
    • Contact Aleksej for access to the website with ACR data, if you do not have it already
  • Verify that in key metrics selection panel Top traffic source driving purchases widget is not available
  • Enable conversionReporting feature flag
  • Go to key metrics selection panel and choose Top traffic source driving purchases tile
  • Verify it widget is showing data, and matching the figma design
  • Go to analytics settings - switch to different account/property, and verify that Top traffic source driving purchases widget is showing zero data (since widget will only have data on property that has ACR data)

Changelog entry

  • Add the Top traffic source driving purchases widget.
@10upsimon 10upsimon added javascript Pull requests that update Javascript code Module: Analytics Google Analytics module related issues Team S Issues for Squad 1 Type: Feature New feature labels Aug 7, 2024
@jamesozzie jamesozzie added the Needs Documentation Issues which require new or updated public-facing documentation. label Aug 7, 2024
@binnieshah binnieshah added the P0 High priority label Aug 19, 2024
@zutigrm zutigrm assigned zutigrm and unassigned zutigrm Aug 23, 2024
@10upsimon 10upsimon assigned 10upsimon and unassigned 10upsimon Aug 26, 2024
@zutigrm zutigrm assigned zutigrm and unassigned zutigrm Aug 28, 2024
@eugene-manuilov eugene-manuilov self-assigned this Sep 3, 2024
@eugene-manuilov
Copy link
Collaborator

IB ✔️

@eugene-manuilov eugene-manuilov removed their assignment Sep 3, 2024
@binnieshah binnieshah removed the Needs Documentation Issues which require new or updated public-facing documentation. label Sep 11, 2024
@zutigrm zutigrm self-assigned this Sep 23, 2024
@zutigrm zutigrm removed their assignment Sep 23, 2024
@10upsimon 10upsimon assigned 10upsimon and unassigned 10upsimon Sep 26, 2024
@zutigrm zutigrm assigned eugene-manuilov and unassigned zutigrm Sep 27, 2024
@eugene-manuilov eugene-manuilov removed their assignment Sep 30, 2024
@mohitwp mohitwp self-assigned this Oct 1, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Oct 2, 2024

QA Update ✅

  • Tested on dev environment.
  • Verified that Top traffic source driving purchases widget is not available under KMW panel if conversionReporting feature flag is not enabled.
  • Verified that Traffic source that generates the most purchases used for description and the tooltip.
  • Verified that widget is showing correct data, and matching the figma design.
  • Verified that widget changes the color of percentage as per negative and positive trends in data.
  • Verified the Top traffic source driving purchases widget is showing zero data if data is not available for selected property or selected date range.

image

image

image

image

image

@mohitwp mohitwp removed their assignment Oct 2, 2024
@tofumatt tofumatt closed this as completed Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code Module: Analytics Google Analytics module related issues P0 High priority Team S Issues for Squad 1 Type: Feature New feature
Projects
None yet
Development

No branches or pull requests

7 participants