Target known visitors with Dynamic Customer Profiles

  • Updated
  • Optimizely Web Experimentation
  • Optimizely Personalization

You must have Optimizely Personalization for this feature.

Use dynamic customer profiles (DCP) with Optimizely Personalization to directly expose content attributes in the browser to deliver 1-on-1 personalization to your customers in your experiments and campaigns.

Attributes describe what you know about your individual customers, such as their favorite products, lifetime value scores, and loyalty memberships. In general, attributes help you create tightly tailored experiences for every known customer on your site.

Content attributes are the attributes that you mark Content-enabled in DCP. These attributes values can be displayed to customers who visit your site. Content attributes let you deliver personalized messages based on your knowledge of an individual customer.

For example, if you want to use your customers' membership levels to personalize a greeting on the landing page, you can enable the membership level attribute to create a message such as "Welcome, gold-level member!" The membership level greeting changes according to the visitor’s membership level.

To learn more, see Optimizely Personalization.

The Experimentation terms of service prohibit you from sending any personally identifiable information (PII) such as names, social security numbers, email addresses, or any similar data to the Experimentation system through list attributes or other features.

Set up DCP

Set up dynamic customer profiles in Optimizely Web Experimentation.

Enable content attributes

Mark the attributes you want to display as Content-enabled in the Add Attributes view.

Go to Audiences > Attributes and click More Options (...) for the table that contains the attributes you want to edit. Select Edit Attributes.targeting-17.png

Check Content-enabled next to any attribute you want to display in the customer's browser.


Set the JavaScript API 

Provide your developer with the following JavaScript API:

optimizely.get('dcp').getAttributeValue({datasourceId: 012345678910, attributeName: 'membershipLevel'})

You also want to give your developer the data source ID and the attribute name. In the following example, the data source ID is 012345678910. The attribute name is “membership level”. 


Create a campaign

See Create a campaign in Optimizely Personalization.

Make sure to include an audience that uses a condition that references at least one table attribute. This ensures that the Optimizely Web Experimentation snippet makes a targeting request with a response including the values of all content-enabled attributes. If no such audience conditions exist, the Optimizely Web Experimentation snippet does not make any targeting requests, and content-enabled attributes are not returned to the browser.


Expose the content attribute

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

Click Variation Code Editor to open the custom code box in the experience that you created.

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.  The code might look similar to the following 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 following example, the platinum level value is also the default value. The code would then be: 

optimizely.get('dcp').getAttributeValue({datasourceId: 012345678910, attributeName: 'membershipLevel'}) || 'bronze'

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

Test your campaign, then publish it.