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.
- Log into Business Manager.
- Click Administration > Sites > Manage Sites.
- 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.
- Log into Business Manager.
- Click Merchant Tools > Site Preferences > Privacy Settings.
- 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.
Event | Description | PWA Kit Support |
---|---|---|
Product Impression | Counts how many times a product is shown in minimal detail on a page. Examples include search results, recommendations, and banners. | Yes |
Product View | Counts how many times a product is shown in great detail on a page. Examples include product detail and comparison pages. | Yes |
Order | Counts how many times a customer placed an order. | Yes |
After completing the prerequisites, install Active Data by following these steps:
- Run
npm run build
to rebuild the PWA Kit bundle. - 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:
- Log into Business Manager.
- Open your Product Catalog.
- Open a product.
- 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.
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.
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.