Personalization Engine SPM JS setup with tag manager using async tags

Instructions for implementing Personalization manager can be found here:

Some tag managers may load JavaScript that Personalization Manager also relies on asynchronously, so you may need to customize the standard setup code. If the Require.js loads after Sailthru's SPM JS, then you may see a Uncaught ReferenceError: Sailthru is not defined error returned on the page.

If your site uses Tealium or GTM in async mode, you may need to implement the tag in this manner.

// Sets up JS
require.config( {

{ "Sailthru": "", }

waitSeconds: 300,
shim: {

{ exports: 'Sailthru' }


// Executes JS
require(["Sailthru"], function (Sailthru) {
console.log("Optional console log text!");

{ customerId: '<paste customer ID here>'}



An example of non-async Tealium tags:

<script type="text/javascript">
(function($) { if ("<account>" in $ && "utagClassic" in $.<account>) $.<account>.utagClassic.initialize("//<account>/<site>/prod/utag.js"); }


Note that this code should be thoroughly tested before implemented in any production environments.