Google Optimize Integration Installation Guide


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.

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 Demandbase variable with the Custom JavaScript option in your experiment

2.1 In your experiment, once you have determined your variants and objectives, click the Targeting tab and then click the Create Rule button.


2.2 Select the Custom JavaScript option, which is third from the bottom.


2.3 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 replace the underlined industry in the code above with the API variable name of any of the Demandbase firmographic attributes listed in this article.

Step 3: Create a Rule with your Demandbase variable

3.1 When you have finished creating the custom variable, you may then create a rule utilizing that variable.


3.2 Click the Add button in the screenshot above to confirm the rule in the Targeting tab below.

Step 4: Customize your content with Demandbase data

*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.

4.2 Insert your custom code into the JavaScript editor to trigger those changes. If you would like to use Demandbase data (e.g. Marketing Alias or Company Name) in your customized content, you will need to access it from the data layer. You may 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 may 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