How to extend Active Data in Salesforce B2C Commerce Cloud

When working on personalization and segmentation within Salesforce B2C Commerce Cloud, Active Merchandizing is one of the tools to help you along the way.

By utilizing data collected automatically by Salesforce B2C Commerce Cloud, you can gain a deeper understanding of your customers’ behavior and tailor campaigns accordingly. For instance, we display a distinctive banner to frequent visitors compared to those who only visit sporadically.

How is Active Data gathered?


When looking at “out-of-the-box” data gathering, we mean all data gathered by analytics that happens on Salesforce B2C Commerce Cloud channels such as:

  • Storefront Sites such as SiteGenesis / SFRA
  • Headless OCAPI / SCAPI channels

The data collection happens either by client-side tracking (JavaScript – e.g. <isobject>) for information such as product views or server-side events such as placing orders.

					// Example of the client-side generated scripts

<script type="text/javascript">//<!--
/* <![CDATA[ (viewProduct-active_data.js) */{id: "5024501", type: "detail"});
/* ]]> */
// -->

Extend Active Data

Besides all of the standard fields available for merchandising, you can extend the model with your own data!

This can be particularly useful if you create campaigns/personalisation based on customer actions originating on systems/places outside of Salesforce B2C Commerce Cloud.


As for the example flow, we are going to be using visits to a physical store as an example:

  • Visits in the last 24 hours
  • Visits in the last 30 days

By utilising this information, we can categorise individuals into a specific customer group and create a marketing campaign to target those who make purchases online and offline.

Step 1: Extend the System Object

There are two System Objects that we can extend:

In this case, we want to extend the Customer Active Data, so we head to:

Administration > Site Development > System Object Types > Customer Active Data

On the “Attribute Definitions” tab, we click “New” to start creating our new attributes.

system object active data physicalVisits
Create physicalVisits
system object active data physicalVisitsMonth
Create physicalVisitsMonth

As with any attribute, if we want to be able to view them in the Business Manager screens, we should not forget to add them to a new or existing “Attribute Group”.

To do this, we go to:

Administration > Site Development > System Object Types > Customer Active Data – Attribute Groups

Once here, let us create a new group called “Physical Store Traffic”, and assign our two new attributes.

system object active data attributegroup
Attribute Group Assignments

Step 2: Create the feed definition (CSV)

Now that our attribute model has been extended, we need to create a way of importing that data. The first step to allowing CSV import is to create a “feed”.

To do this we need to head over to the “Feed Definitions”:

Merchant Tools > Online Marketing > Active Data > Feed Definitions

In the overview, we see our two types of active data again. Here we will be creating a feed for Customer Active Data.

Click the “new” button and create our feed! On the next screen decide on the following fields:

  • ID: The ID of the feed. We will need this in our CSV file later (I have chosen “customer-physicial-store-information-feed”)
  • Description: Free text to describe the purpose of the feed
  • Fresh Period: The value is the number of days after which the data becomes stale if it’s not updated. 0 means the data is never considered stale.
new customer active data feed
New Customer Active Data

Step 3: Create the file to import

SFCC understands what we want to send to the system by defining the feed. 

Now on to creating the file for import! A simple CSV file, with the data that our external system is generating.



Some things to keep in mind with this file:

  • The first line should be empty!
  • The second line is the ID of the feed we defined earlier (it tells SFCC which feed this file is for)
  • The third line is our header
  • Custom attributes, like in code, are defined in the header starting with “custom.”

Step 4: Import the CSV file

There are two ways to import this file:

  • Through the business manager

    Merchant Tools > Online Marketing > Active Data > Import & Export

  • Through an automated job using the Job Step “ImportActiveData

Step 5: Check that it worked!

Once the import has been completed we can go and check on a profile if that import succeeded!

customer active data sfcc
SFCC Customer Active Data

And with this new addition, we can start creating new Dynamic Customer Groups, for example!

dynamic customer group
Dynamic Customer Group: Visited today
Demandware Customer Active Data

Salesforce B2C Commerce Cloud: Active Merchandizing

Table of Contents