---
schema_version: "1"
id: 47cfe740ab764094f5f25717a6f42147c205c47c2b2646e0fb24d5295d25b5f3
title: Setting Up Active Data for Testing
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/cc/264-0-0/b2c_setting_up_active_data_for_testing.md
canonical_url: https://help.salesforce.com/s/articleView?id=cc.b2c_setting_up_active_data_for_testing.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: cb33211a7d6be334e4d593d0de7a86bdf954728cf6e0e8de4a700579236846c1
description: Test active data sorting rules as an ongoing maintenance task. Other than A/B testing, most testing takes place either on a Staging or Sandbox instance. This is because the B2C Commerce Storefront Toolkit, used to examine search results, is available on Staging and Sandbox systems, but not on Production.
products:
  - Commerce
  - B2C Commerce
release: "264"
---
# Setting Up Active Data for Testing

Test active data sorting rules as an ongoing maintenance task. Other than A/B testing, most testing takes place either on a Staging or Sandbox instance. This is because the B2C Commerce Storefront Toolkit, used to examine search results, is available on Staging and Sandbox systems, but not on Production.

If active merchandising is enabled, then data is automatically imported into Production and Staging instances. However, if active merchandising isn't yet enabled or you want to test on a Sandbox instance, you must import active data to test. Salesforce B2C Commerce provides two files of SiteGenesis data that you can use: activedata-product-Sites-SiteID-Site-YYYYMMDD.csv and activedata-customer-Sites-SiteID-Site-YYYYMMDD.csv. You can also edit these files to represent your products and import them into the SiteGenesis site. If you do edit the files, add your products to the SiteGenesis site to test.

## Getting Active Data into Your Testing Instance

To test active data sorting rules or customer groups before you have enabled active data, import an active data file provided with SiteGenesis into your Sandbox. If you have enabled active data for your site, you can download the active data feed from your production instance and import it into your Sandbox.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-cc-b2c_merchandiser_administrator-264-0-0-production-enus/ea76f372-6cfa-42a6-8e7c-05c6df7abed8/images/icon_note.png)

Note The active data file, which normally contains data, is collected on the storefront and aggregated by the Merchandising Analytics process. This file isn't the active data feed file, which is used to feed other attributes, such as costPrice and returnRate. However, consider creating an active data feed file for testing.

Using SiteGenesis Data to Test

To use sample data from SiteGenesis for initial tests, import the sample active data files provided into B2C Commerce. If your eCommerce site has data from before moving to B2C Commerce, such as information about sales or page views, consider using the SiteGenesis .csv files as examples and create your own data file.

Using Data from Your Production Instance to Test

To use data from your production site to experiment with new sorting rules on your sandbox:

- To export the active data feed as a .csv file, download active data from production.
- Import active data CSV files into your sandbox.

## Modifying the Active Data Files for Specific Tests

Edit the SiteGenesis active data file or create a test active data file for your site. If you’re using the SiteGenesis storefront to test your rules, make sure to use the original names of the files after you edit them. If you’re using your own storefront to test, the file you import must follow the naming conventions for active data feeds.

Editing the active data File

Salesforce recommends that you use Notepad or another text editor to construct or edit the file. If you use Excel to edit the file, open it in Notepad or another text editor and make sure it conforms to the correct file format. For example Excel removes the first blank line, adds commas to the second line, and adds leading zeros to any decimal values. Excel can also change the format of long numbers, such as product IDs.

Although the active data file is in .csv format, it also requires the following formatting:

- The first line must be blank
- The second line must contain the text: Demandware Product Active Data or Demandware Customer Active Data
- The third line must contain the name of all active data attributes to import in the correct order

This example of the activedata-product-Sites-SiteID-Site-YYYYMMDD.csv file is edited to contain extra data for three wombat products.

![Example of an edited active data CSV file for product import](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-cc-b2c_merchandiser_administrator-264-0-0-production-enus/ea76f372-6cfa-42a6-8e7c-05c6df7abed8/cc/b2c_merchandiser_administrator/images/b2c_active_merchandising_edited_csv_file.gif)

## Evaluating Active Data

To evaluate active data:

First, to confirm that your active data imported successfully and view the results for a specific product or customer, view active data attributes.

Second, rebuild the active data index. Click App Launcher ![App Launcher](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-cc-b2c_merchandiser_administrator-264-0-0-production-enus/ea76f372-6cfa-42a6-8e7c-05c6df7abed8/cc/b2c_merchandiser_administrator/images/appLauncher.png), and then select **Search** | **Search Indexes**. Select the **Active Data Index** and click **Rebuild**. If you don't rebuild the index after importing active data, the active data isn't used in the storefront.

Third, examine the active data index. Click App Launcher ![App Launcher](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-cc-b2c_merchandiser_administrator-264-0-0-production-enus/ea76f372-6cfa-42a6-8e7c-05c6df7abed8/cc/b2c_merchandiser_administrator/images/appLauncher.png), and then select **Search** | **Search Indexes** | **Active Data Index**. On the Statistics tab you can see all the indexed values, including any slicing groups for variations.

Fourth, use the Storefront Toolkit Search Information Tool to determine how sorting rules are using the active data.

## Active Data Sorting Rule Testing

B2 Commerce supports sorting rules with active data sorting attributes. Use the Search Index Query Testing (SIQT) tool to test sorting results in a storefront and when testing an active data sorting rule.

## Related Links

[Checklist for Active Merchandising](https://help.salesforce.com/s/articleView?id=cc.b2c_checklist_for_active_merchandising.htm&release=264.0.0&type=5 "To implement active data for a B2C Commerce site, tag the site for data collection and import other attribute values.")