Demandbase Sitecore Installation and Usage

Updated:

Installing the Sitecore Demandbase module using the Sitecore package

Acquire the package

The Sitecore Demandbase plugin will be delivered by a member of our Services team during kick-off.

Versions Supported: 7.1 through 8.2

Install the package

Using preferably a non-production environment, install the module package using Sitecore's Development Tools > Installation Wizard.

  • Upload package to Sitecore
  • Run installation procedure

There are no Sitecore items involved in the module package. The entirety of the module is self contained through initialize pipeline procedures. This means if something is accidentally deleted it can be easily repaired with a simple recycle of the app pool.

 

 

 

Configure the module

Installing the module will place a configuration file in Sitecore at App_Config/Include called SitecoreDemandbase.config. Inside this config is an Xml node to enter your Demandbase api access key.

In the WebConfig you'll place your API KEY 

Injecting Demandbase attributes into rich text

This Step is optional, it allows you to inject whatever demandbase attributes are associated with the current user into rich text. Through integration with another 3rd party module Token Manager

Token Manager

The Sitecore Tokenmanager is a Sitecore Module that allows content authors to inject dynamic or managed content into a rich text field. This is particularly useful for Demandbase as it allows us to inject demandbase data into our content.

Installing Token Manager

Token Manager is available to install via nuget using visual studio or the package manager console command: Install-Package Token Manager. Install into your web solution and make sure the dll is in the bin folder and configuration file (tokens.config) is under App_Config/Include.

Integrating with Demandbase

There is nothing to do here, Token manager will detect the token definitions which are contained within the Demandbase module and wire up the tokens for use automatically. So simply install Token Manager and you're done.

Injecting Dynamic Attribute

After installing there will be a new button in the rich text editor that looks like an orange lightning bold. If you click this button you will be shown a form to fill out for which attribute you would like to inject onto the page. During edit mode this will show up as a blue highlighted placeholder reporting what attribute will be returned. Once outside of edit mode it will be resolved into a value for the particular attribute based on the user viewing the page.

Testing attribute based personalizations

There is a widget included in preview mode to simulate a particular ip. With this we can render the page as it would be seen from a particular consumers ip. This works by setting a cookie in your browser, once you have the cookie set you will impersonate that ip until you erase it from the widget or clear your cookies. However an important note is that in order to test personalization you need to be in normal rendering mode. You can enter normal mode by changing the sc_mode query string parameter to sc_mode=normal.

ALTERNATIVE TO IP WIDGET

Spoofing an IP Address

    • Set Cookie to Spoof IP Address: To spoof an IP address, you can create a cookie called “demandbasemockip” and set the value to the desired IP address.  The effect would be the same as using the IP Address Simulator widget.  Please find below additional reference information & tools for setting a cookie.  Also, an important note is that in order to test personalization you need to be in normal rendering mode. You can enter normal mode by changing the sc_mode query string parameter to sc_mode=normal.
 

Utilizing personalization through a CDN

Understanding CDNs

What it boils down to is a CDN caches the HTML output and whenever anyone requests a page it simply returns a flat HTML version of your page. This is amazingly powerful when it comes to getting fast response times, however it's almost completely incompatible with any form of dynamic content with a few exceptions.

Pass through

CDNs will give the ability to white list pages that will always retrieve content from the source, in our case Sitecore. This requires foresight from content authors as well as cooperation from the team managing the CDN to white list any pages that are going to be personalized before the personalization is live.

It's very important that you make sure the white list of a page is intact before setting up personalization, otherwise when the CDN refreshes the page cache for a particular user it faces the risk of caching personalized content. At which point you could be delivering content for a specific target audience to everyone.

Javascript

While significantly more complex, you can utilize javascript to dynamically load personalized content. Sitecore doesn't provide a solution for this out of the box, but if needed the steps to accomplish this would be.

  • Create an endpoint for personalization
  • white list this endpoint to pass through the CDN
  • Patch into Sitecore's conditional rendering engine to place an identifier instead of resolving the personalized placeholder
  • On page load detect these identifiers and send them to your endpoint including the page guid and placeholder attempting to render
  • Your endpoint will take the page id, as well as placeholder and return personalized html
  • Your javascript will then replace the identifiers with the HTML returned from the endpoint

Recommendation

Due to the simplicity, we would recommend the pass through of personalized pages approach.

 

 

Was this article helpful?
0 out of 0 found this helpful