This article will help you:
  • Enable the Demandbase integration in Optimizely
  • Create new audiences using the Demandbase integration

The Demandbase integration creates targeted B2B audiences for delivering personalized content to the companies you care about the most. Demandbase's technology allows you to do this on the very first visit to your website, before these companies have even identified themselves to you.

1. Enable Demandbase in Optimizely

  1. Navigate to the Integrations tab on the Home page.

  2. In the list of integrations, click Demandbase.

  3. In the right sidebar, toggle the button to On.

  4. Enter the required API key (also called a ‘token’), which your Demandbase Customer Success Manager can provide.

  5. Click Save.

With the Demandbase integration enabled, Optimizely will deploy the Demandbase tag and fetch visitor data from Demandbase for each pageview.

2. Create an Optimizely audience

Next, create an audience in Optimizely based on company information in Demandbase. Or, add Demandbase conditions to an existing audience.

  1. Navigate to Overview > Audiences and click New Audience.

  2. Click Demandbase to see a full list of targeting conditions. Hover over the question mark to see a description.

    For more information on the attributes, see this Demandbase overview (you'll need to log in to Demandbase to view it).

  3. Drag a condition to select and complete the open fields. You may want to work with your Demandbase Customer Success Manager on the exact formatting to use for different fields.

  4. After you set your audience conditions, click Save Audience

Here's an example of an audience with the following conditions:

Industry = Financial Services
Employee Range = Enterprise
Revenue Range = $2.5B - $5B OR Over $5B

Here is what it looks like in the Audience builder:  

Activation on first page visit

This integration works by asynchronously loading company data from Demandbase as the page is rendering, and storing the data in the visitor's browser. This means that experiments will trigger only when the visitor comes back to the page, on their second page visit or later.

If you'd like to trigger an experiment on first page visit, you can tell Optimizely to wait for company data from Demandbase to load using conditional activation.

Here's how to enable conditional activation for an experiment, with step-by-step instructions below.

  1. In the Editor, click Options > Activation Mode.

  2. Select Conditional.

  3. Copy the following code (which make sure to activate the experiment only after visitor data from Demandbase is available) and paste it into the text box:

    function(activate, options) {
      // Interval in ms for polling Demandbase visitor data
      var POLL_INTERVAL = 50;
      // Max number of poll attempts
      var MAX_POLL_COUNT = 5;
      var pollCount = 0;
      function poll() {
        if (window.optimizely &&
            !options.isActive) {
        } else if (pollCount < MAX_POLL_COUNT) {
          setTimeout(poll, POLL_INTERVAL);
  4. Click Apply.

  5. Save the experiment.

You should now see your experiment trigger on the first page visit.

Conditional activation means that the experiment may trigger after all the content on the page has loaded, thus causing flicker.  If you want to prevent the experiment from triggering after a certain timeout, you can edit the POLL_INTERVAL and MAX_POLL_COUNT in the conditional activation code above.  

For example, the current poll interval of 50 and max polls of 5 will ensure that Optimizely will not trigger the experiment after more than 200ms.