This article will help you:
  • Integrate with Optimizely is an Audience Data Provider and Platform for information on socio-demographics, product interests/affinities and consumer behaviour. This data allows you to define Optimizely Custom Dimensions, which in turn allow you to analyze your results and target your experiments by otherwise unavailable attributes. This article explains how to get started.


This integration requires a subscription and an Optimizely Enterprise account. You will use Optimizely's JavaScript API to assign a visitor to a custom dimension when it is a member of a audience. 


The dimensions of the audience can vary according to your specific subscription.

You will also need the following:

  1. a Javascript tag with your network ID and site ID in the form:   <script type='text/javascript' src="//"> </script> this will be provided to you by
  2. the output mapping list enables you to translate the key value logic into human readable audience dimensions. This list has a simple format like:

Deploy integration snippet

In the following block of example code, the tag will be provided to you by with your specific IDs. You should also insert the Optimizely snippet, which you can find under the Settings tab in your Optimizely Home page.

Insert this code at the bottom of your head tag to load the Optimizely snippet. A standard implementation would deploy this site wide:

 <!-- -->
<script type='text/javascript' src="//">

< type='text/javascript'> 
  window['optimizely'] = window['optimizely'] || [];
	window['optimizely'].push(["customTag", {
  //namings like ”gender” can be free defined  
  gender: nuggAIArray.d1,
  age: nuggAIArray.d2,
  Size_of_household: nuggAIArray.d3,
  Kids_in_household: nuggAIArray.d4,
  Main_income_earner: nuggAIArray.d7,
  responsability_for_household: nuggAIArray.d8,
  Level_of_education:  nuggAIArray.d9,
  Employment_status: nuggAIArray.d10,
  Personal_income: nuggAIArray.d11,
  Household_income: nuggAIArray.d12
  // … and so on

<!-- your Optimizely Snippet -->
<script src="// ID__.js"></script>
<!-- -->

The naming of audience dimensions e.g. “gender”, “age” is up to you. Usually you would probably make it more encrypted, maybe even just using the keys like “d1”, “d2” etc. The mapping can also take place when assigning an Optimizely Audience.

Also the number of dimensions can vary according to your subscription, e.g. there could be dimensions like “car interest” etc.

Visitors will now be included in Custom Tags which can be used to create new audiences in Optimizely and track in the results page.

Use custom tag in experiment

When you have a list of fields and values can deliver, you can target those values with custom tags in Optimizely. You can read more about how to use custom tags in the article Audience conditions: Descriptions and examples. The custom tag “tag” should match the field that returns (like “age”). The “value” should match the value that returns.