Active Data

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

  • Observe product performance and order 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. Active Data also collects order metrics. The metrics in Active Data can be used to:

  • Analyze shopper on-site behavior so you can enhance the shopper experience and optimize product offerings to drive sales growth.
  • Configure site rules - like automated merchandising - in Business Manager.

When a shopper opts out of behavior tracking, the Active Data for that shopper’s session isn't collected or reflected in Active Data. This applies regardless of whether you enabled tracking in Business Manager.

To use Active Data:

  • To access the product impression and product view events, build your site using PWA Kit version 3.3.0 or later. If you have an earlier version that doesn't support Active Data, upgrade your project to use PWA Kit 3.3.0 or later.
  • 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 environment. See Configure Managed Runtime Environments.
  • Configure Business Manager.

Open a support case asking Salesforce Customer Support to enable data collection.

  1. Log into Business Manager.
  2. Click Administration > Sites > Manage Sites.
  3. Confirm that the status is Online for the sites for which you want to track metrics. Active Data is collected only for live (online) sites.
  1. Log into Business Manager.
  2. Click Merchant Tools > Site Preferences > Privacy Settings.
  3. Confirm that Tracking (Default for New Storefront Session) is set to Enabled.

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.Yes

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.

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.

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. Log into Business Manager.
  2. Open your Product Catalog.
  3. Open a product.
  4. Click the Active Data tab to confirm that the traffic and conversion metrics in the sample data shown below are incrementing based on the time durations.

Associated screenshot

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.

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.