This article will help you:
  • Deliver 1-1 personalization to customers with Dynamic Customer Profiles
  • Display content attributes directly in a customer's browser

With Dynamic Customer Profiles (DCP), you can directly expose content attributes in the browser to deliver 1-1 personalization to your customers. 

Attributes describe what you know about your individual customers: their favorite products, lifetime value scores, loyalty memberships, and other information. In general, attributes help you create tightly tailored experiences for every known customer who comes to your site with DCP.

Content attributes are the attributes that you mark Content-enabled in DCP. These attributes values can be displayed in the browsers of customers who visit your site.

Imagine that you'd like to use your customers' membership levels to personalize a greeting on the landing page. By enabling the "membership level" attribute, you can create messages like: "Welcome, gold level member!" The “membership level” greeting would change according to the visitor’s membership level.

Content attributes allow you deliver personalized messages based on what you know about an individual customer.


Dynamic Customer Profiles are available with the Personalization Professional plan. To learn more, check out Optimizely Personalization.

You can also read more about DCP on the Optimizely blog.


Remember, your terms of service prohibit you from collecting or sending any personally identifiable information (such as names, social security numbers, email addresses, or any similar data) to Optimizely's services or systems through Dynamic Customer Profiles or any other feature.

Please read the article on PII to learn more about sending data to Optimizely and handling personally identifiable information.

1. Set up DCP

To begin, set up Dynamic Customer Profiles in Optimizely.

2. Enable content attributes

Mark the attributes you'd like to display as Content-enabled in the Add Attributes dialog.

Go to the Implementation tab in Optimizely Personalization, then the Attributes sub-tab.

Click the Actions icon () and select Edit Attributes from the drop-down menu.

Check Content-enabled next to any attribute that you'd like to display in the customer's browser. Below, we've made the “membership level” value available for display in the browser.

3. Set the JavaScript API 

Provide your developer with the following Javascript API:

optimizely.get('dcp').getAttributeValue({datasourceId: 1234567890, attributeName: 'membership level'})

You’ll also want to give your developer the data source ID and the attribute name.

In the example above, the data source ID is 1234567890. The attribute name is “membership level.” Go to our developer documentation to learn more.

4. Create a Campaign

Next, create a Campaign.

Make sure to include an Audience that evaluates any attribute from any data source that you’re connecting through DCP.

For instance, you can create an Audience that evaluates the “membership level” attribute or the “purchased in store” attribute from the Attic & Button Data Warehouse. The specific attribute and data source don't matter. As long as you include an external (non-Optimizely) data-source in your Audience, you’ll ensure that all content attributes are fetched from the server.

5. Expose the content attribute

Create your 1-1 personalized Experience by exposing the content attribute to visitors.

Navigate to the Custom Code box in the Experience that you’re creating.

In the Custom Code box, use the JavaScript API from Step 2 to display the attribute you want your customer to see. The datasourceID value and the attributeName value are the same values you provided to your developer in Step 2. 

Here's what the code might look like in the custom code box:

Because the content attribute you display might not be available for all visitors to your site, add the following code to create a default experience:

optimizely.get('dcp').getAttributeValue({datasourceId: 123, attributeName: 'Attribute Name'}) || default_value

Pick a default_value that can replace the content attribute for a generic experience. In the example below, the bronze level value is also the default value. The code would then be: 

optimizely.get('dcp').getAttributeValue({datasourceId: 1234567890, attributeName: 'membership level'}) || 'bronze'

Not all visitors to the site have a membership level to display. So, instead of saying “Welcome, gold level member!” the default (and bronze level) experience might be designed to say: “Welcome!”

6. QA and publish

QA your Campaign. Then, publish it live to the world!