site-kit-wp
site-kit-wp copied to clipboard
Creation of `Top device driving purchases` ACR KMW
Feature Description
One of the identified metric tiles for the ACR epic is Top device driving purchases. Details of this metric tile are as follows:
- Description: Total number of purchases for the top device. 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 - Order: Descending
- Purpose: Inform users of the best performing device so they can take action in that direction if needed. If their top platform driving purchases is mobile, maybe they need to put additional effort to ensure a smoother add to cart experience for visitors in order to keep growing this metric, etc.
- 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 device driving purchaseACR 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
ecommercePurchasesmetric for thedeviceCategorydimension (using the 1st/top device category from the results) Top device driving the most purchasesshould be used for description and the tooltip- Widget will not be displayed, or shown in the selection panel list if
purchaseevent is not present, orconversionReportingfeature flag is not enabled
Implementation Brief
- [x] Update
assets/js/googlesitekit/datastore/user/constants.js- Include new constant, say
KM_ANALYTICS_TOP_DEVICE_DRIVING_PURCHASES, holding a stringkmAnalyticsTopDeviceDrivingPurchases
- Include new constant, say
- [x] Update
assets/js/components/KeyMetrics/key-metrics-widgets.js- Register new widget for
KM_ANALYTICS_TOP_DEVICE_DRIVING_PURCHASES - Use "Top device driving purchases" for
title - Use "Top device driving the most purchases" for
descriptionandtooltip - Include new property
requiredConversionEventName, and assign it an array value containingpurchaseevent name - In
displayInListpass the helper functionshouldDisplayWidgetWithConversionEvent
- Register new widget for
- [x] Add
assets/js/modules/analytics-4/components/widgets/TopDeviceDrivingPurchases.js- You can use
assets/js/modules/analytics-4/components/widgets/TopTrafficSourceWidget.jsas a starting point due to the similarity, with difference in report options - In
totalPurchasesReportOptions:- Use
ecommercePurchasesmetric
- Use
- In
deviceReportOptions:- Use
deviceCategoryfor dimensions - Use
ecommercePurchasesmetric
- Use
- You can use
- Update
assets/js/modules/analytics-4/index.jsto include new widget registration
Test Coverage
- Add stories for the new widget
QA Brief
- Setup Site Kit with the Analytics module enabled
- Contact @zutigrm for access to the test website containing ACR data
- Verify that in key metrics selection panel the
Top device driving purchaseswidget is not available - Enable the
conversionReportingfeature flag - Navigate to the key metrics selection panel and select the
Top device driving purchasestile - Verify that the widget is showing data, and matching the Figma design in the AC.
- Go to Analytics settings - switch to a different account/property, and verify that the
Top device driving purchaseswidget is showing zero data (since the widget will only be having data on properties that have required ACR events and data associated with them)
Changelog entry
- Add Top Device Driving Purchases Key Metric Widget.
AC ✔️
IB ✔️
QA Update ✅
- Tested on dev environment.
- Verified that under key metrics selection panel the
Top device driving purchaseswidget is not available if'conversionReporting'feature flag is not enabled. - Verified that under key metrics selection panel the
Top device driving purchaseswidget is available if'conversionReporting'feature flag is enabled. - I verified that the Top Device Driving Purchases widget matches the Figma design. However, I noticed that the device name font size is 16px in Figma and 18px in the actual implementation. I believe the 18px size looks better, as 16px appears too small, so I won’t raise this difference.
- Verified
Top device driving the most purchasesused for description and the tooltip. - Verified widget data is correct.
- Verified negative and zero data state of the widget.