Google Optimize Integration Installation Guide

  • Updated


Google Optimize lets you test and build analysis around unique user experiences on your company’s website. Integrating Demandbase with Google Optimize allows you to build user experiences with Demandbase firmographic data and then test those experiences to ensure optimal user interaction on your web pages.

Step-by-Step Guide

Integrating Demandbase with Google Optimize takes just a few minutes using these steps:

Step 1: Link your Google Analytics account with Google Optimize

1.1 In the right Container Information sidebar of your Google Optimize container, link your Google Analytics account with Google Optimize by clicking the Link property button.


1.2 Select a GA property and any associated views.


Step 2: Create a New Demandbase Experience

2.1 Create a new experience type using either A/B Test, Multivariate Test, or Personalization.


2.2 Update Variants (A/B & Multivariate Tests) or Site Changes (Personalization test) and the page targeting URL to desired changes and URL.


2.3 Within the Audience Targeting section, create a new custom rule type using Custom JavaScript.


2.4 In the Custom JavaScript window, insert the following code into the code editor to utilize a Demandbase attribute like Industry:

function () {

if (window.Demandbase.IP.CompanyProfile && window.Demandbase.IP.CompanyProfile.industry) {

return window.Demandbase.IP.CompanyProfile.industry


return 0;




NOTE: To use other Demandbase data attributes, you may need to replace the underlined industry in the code above with the API variable name of any Demandbase firmographic attributes listed in this article.

2.5 When you are finished creating the custom variable, you can then create a rule utilizing that variable.


Step 3: Create a New Activation Event

3.1 At the bottom of the experience details page, you will need to update the Activation Event.


3.2 Within the activation event, update the settings as they are shown in the following image:


NOTE:  The Demandbase team must update your Demandbase tag to officially enable the activation event referenced above before you can begin testing.

Step 4: Customize Your Data with Demandbase Data

NOTE:  For this step, it is strongly recommended to have a technical resource available with expertise in JavaScript and HTML.

4.1 In the content editor, select the element that you want to customize and then select a Javascript change. You may do this with the selector in the top navbar or the blue Edit Element button in the bottom right editing box.
go11.png go12.png

4.2 Insert your custom code into the JavaScript editor to trigger those changes. If you want to use Demandbase data (for example, Marketing Alias or Company Name) in your customized content, you need to access it from the data layer. You can use the following code to grab the index of the Demandbase data within the data layer:

var idx;

dataLayer.forEach(function(el, i) {

  if (el.registry_company_name) {

idx = i;



In the example below, we've used the index ('idx') to access the 'marketing_alias' data from the data layer. You can change the 'marketing_alias' data attribute to any other Demandbase data attribute for use in your customized content. For instance, if you wanted to use 'company_name', just replace 'window.dataLayer[idx].marketing_alias' with 'window.dataLayer[idx].company_name'. The full list of Demandbase firmographic attributes can be found here. You may reach out to or your designated Implementation Engineer for further assistance if needed.


Was this article helpful?

0 out of 0 found this helpful