Personalize site content using demand base
2014 26 Feb

Personalize your site content using Demandbase

In any industry, it is critical to provide personalization experiences to customers, suppliers, and partners. The Demandbase platform provides superior personalization using Demandbase Real-Time Identification Services.

Demandbase Real-Time Identification Services enhance published websites, providing a visitor's company profile to create a targeted visitor experience. Specifically, images, content, links or navigation can be customized based on relevant information from Demandbase based on the visitor's company.

With Demandbase you can do various things to your site like :

  1. Displaying relevant banner or background images based on the visitor's industry, company or etc.
  2. Treat your customer with account-specific information.
  3. If you are using webforms you can present specific webforms accordingly or lots of other things depending on your need.

To understand this let's assume a user comes to your site, let's say the user is from the healthcare industry, now with Demandbase, you can replace all your images with images related to the healthcare industry or on contact-us forms you can fill the fields according to data fetched from Demandbase. With Demandbase you can get a sudden increase of hits on your site.

How to implement?

This can be done on both the client side and server side. This blog will be about client-side integration of Demandbase to your site.

Requirement:-

1. Demandbase Key - To get your Demandbase key contact : support@demandbase.com

2. demandbase-1.0.0-min.js

 

APIs for Client side implementation :

1. IP Address API:- Returns the response according to IP

2. Domain API:- Returns the response according to the domain name

 

1. IP Address API

EndPoints : 

1. http://api.demandbase.com/api/v2/ip.xml - Returns the response in XML format

2. http://api.demandbase.com/api/v2/ip.json - Returns the response in JSON format

 

2. Domain API

EndPoints :

1. http://api.demandbase.com/api/v2/domain.xml - Returns the response in XML format

2. http://api.demandbase.com/api/v2/domain.json - Returns the response in JSON format

 

Parameters (for both API's endpoints):

key - Required - Your Demandbase Key
query - optional - IP address or domain name (if this is left blank default IP of the user will be taken)
callback - optional - callback function
page - recommended - recommended value document.location.href
page_title - recommended - recommended value document.title
referrer - recommended - recommended value document.referrer

Responses : 

Identification - if Demandbase found the data in its database
Classification - if Demandbase does not have data for this IP but it is in www.aris.net
Error - If data related to this IP does not exist on both.

Examples : 

1. IP Address XML : 

http://api.demandbase.com/api/v2/ip.xml?key=Your_Demandbase_Key&query=20...

2. IP Address JSON :

http://api.demandbase.com/api/v2/ip.json?key=Your_Demandbase_Key&query=2...

Drupal Personalization :

Step 1 :

Add demandbase-1.0.0-min.js and your custom js (lets say demandbase_custom.js) on your site using (Drupal 7)

drupal_add_js('https://dkj2m377b0yzw.cloudfront.net/clients/javascript/demandbase-1.0.0-min.js', array('type' => 'external'));

Step 2 : In demandbase_custom.js, add the following code snippet

Using ajax :

var myKey = "[Your_Demandbase_Key]";
  jQuery.ajax({
   url: 'http://api.demandbase.com/api/v2/ip.json?key='+myKey+'&page='+document.URL+'&referrer='+document.referrer,
   dataType: 'json',
   success: function(result) {
     // Response handler for IP API call,
     if(result) {
        industry = result.industry || '';
     }
   },
   error: function(xhr, textStatus, errorThrown) {
     // Optional error handler for 404 errors, etc.
   }
  });

using Demandbase Client :

// Instantiate the Demandbase client, passing API key.

var db_client = new DemandbaseClient("[Your_Demandbase_Key_Goes_Here]");
Call the IP address API

If your provide a ip_address then it will give the information for that ip else it will take user's default ip address

var ipAddress = "208.92.40.133";

// Inline function calling, You can also give the name of the function.

db_client.ip(ip_address, function(company)) { 

// Do personalization to your site.

// Company will have all the information about IP address provided.

}

// Passing function name.

db_client.ip(ip_address, some_personalization)

var some_personalization = function(company) {

// Do personalization to your site.

// Company will have all the information about IP address provided.

}

and thats it...!!!!!

For server side integration of Demandbase, there is a module Demandbase however it does not provide any client-side integration.

NOTE: For domain name implementation, replace IP with domain in code like db_client.ip will be db_client.domain.

For Demandbase api documentation please visit Demandbase API documentation.

Please let me know in the comments if you have any queries..enjoy personalization..!!!!

Latest Blogs

webshop

Drupal: The ideal solution for your e-Commerce Website

In the last few decades, the online merchandising sector has made strides at an unprecedented pace following that, the demand and emergence of many e-commerce platforms are on the rise. 

Read More

Drupal 9 Upgrade

The Roadmap to upgrade Drupal site to Drupal 9

Drupal is approaching with its next big evolution and the upcoming release that is none other than Drupal 9.

Read More

How to Choose Web Development Agencies

Points to check before choosing the right website development company

In today’s day and age, where the digital population is increasing exponentially, no credible business can or should refrain from having a strong and steady web presence.

Read More

Wordpress to Drupal

Should I plan to move my Wordpress Website into the Latest Drupal version?

If you're here, I assume you already have a website built on WordPress but you're not satisfied with it, or perhaps you're here to have a clear idea about why you should give a thought to migrating

Read More