Active Data

You can use Active Data in your Progressive Web App (PWA) Kit site to:

  • Observe product performance metrics.
  • Set automated rules for merchandising (for example, search result sorting).

Active Data works by collecting engagement data from shoppers browsing your site and interacting with products. This data is then aggregated into predefined dimensions that are stored and associated with each product in your catalog. That data can be viewed for analytics purposes or used to drive other site configurations in Business Manager.

To use Active Data:

  • Build your site using PWA Kit version 3.3.0. If you have an earlier version, upgrade your project to use PWA Kit 3.3.0.
  • If you haven't already done so, configure an ocapi proxy that points to your B2C Commerce instance. To see the Active Data metrics or attributes in Business Manager, you must use a production instance. See Configure Managed Runtime Environments.

This table identifies the events in a PWA Kit site that Active Data tracks.

EventDescriptionPWA Kit Support
Product ImpressionCounts how many times a product is shown in minimal detail on a page. Examples include search results, recommendations, and banners.Yes
Product ViewCounts how many times a product is shown in great detail on a page. Examples include product detail and comparison pages.Yes
OrderCounts how many times a customer placed an order.No
Gift OrderCounts how many times an order contains at least one unit of a product that is marked as a gift. Implement a gift feature to take advantage of this functionality. To implement gifts, you must set the ProductLineItem object gift attribute to true. For an example, see the SiteGenesis singleshipping.xml templates.No

After completing the prerequisites, install Active Data by following these steps:

  1. Set export const ACTIVE_DATA_ENABLED = true in app/constants.js.
  2. Run npm run build to rebuild the PWA Kit bundle.
  3. Run npm run push to push the rebuilt bundle to Managed Runtime.

Data collected from events on your storefront is automatically associated with the relevant products and aggregated at various time durations. To confirm that this data is flowing correctly:

  1. Open your Product Catalog in Business Manager.
  2. Open a product.
  3. Click the Active Data tab to confirm that the traffic metrics shown below are incrementing based on the time durations.

If the metrics aren’t incrementing as expected, complete these debugging steps:

  • Ensure that you've waited for 24 hours after a supported event happened.
  • Inspect the network activity for the project and confirm that Active Data requests are returning a 200 status code. The URL for an Active Data request includes "_Analytics-Start".

If you completed the debugging steps and the metrics still aren’t incrementing, open a support case.

Note: Events from storefront interactions are collated nightly, so there’s latency between when events occur and when you see data appearing on the Active Data tab.

Associated screenshot

After you Verify your Data, you can use Active Data attributes to power dynamic sort and search result sorting.

To configure sorting, in Business Manager, go to Merchant Tools > Sorting Rules. For more information, see Sorting Rules for B2C Commerce.

Associated screenshot

Currently, Active Data in PWA Kit is limited to product-based use cases. Active Data as a mechanism for customer group segmentation isn’t supported.