UPDATE: This article became pretty old, so I wouldn’t recommend using any of these ideas in practice, but you may read this to explore some possibilities that you may not consider before.

DISCLAIMER: This is an experiment to test a very specific configuration of Adobe’s tools. I wouldn’t recommend using this unless you are very experienced with Dynamic Tag Management, all the listed tools and JavaScript language.
Tools

  • Marketing Cloud Visitor ID Service 1.3.2
  • Adobe Analytics AppMeasurement 1.4.1
  • Test&Target mbox.js version 53
  • Dynamic Tag Manager

Requirements

  • Implement everything in DTM
  • Load Visitor ID Service synchronously (from the header code), so it is available for all the tools
  • Load mbox.js synchronously (from the header code), so it is available during the page loading
  • Load Analytics library asynchronously (from the header code), so it is available ASAP
  • Fire Analytics Pageview ASAP, but include Test&Target campaign measurement

The tricky part The last requirement is a bit tricky, because:

  • library is loaded asynchronously, so it might not be available in the footer code
  • Test&Target is loaded synchronously and the campaign might occur anywhere in the page content
  • For this scenario, there is no support within DTM (in the available Analytics Tool configuration there is only synchronous load in the header or the footer code)

The solution

  • Implement native Marketing Cloud Visitor ID Service
  • Implement native Test&Target Tool (include the latest mbox.js, load synchronously)
  • Implement native Analytics Tool
    • pick Page code is already present
    • configure the Tool
  • Insert the Analytics library code as a Non-Sequential Third Party Tag in the Page Top Page Load Rule
  • Include first part of the synchronization code at the end:
_satellite.setVar("Analytics Library Loaded", true);
if (typeof _satellite.getVar("Page Bottom") !== "undefined") {
    _satellite.track("Analytics Pageview");
}
  • Implement the synchronization in the library code and in the Non-Sequential Third Party Tag in the Page Bottom Page Load Rule (the second part of the synchronization code)
_satellite.setVar("Page Bottom", true);
if (typeof _satellite.getVar("Analytics Library Loaded") !== "undefined") {
    _satellite.track("Analytics Pageview");
}
  • Implement the Pageview call in the synchronized Direct Load Rule

The catch

This way the Analytics Tool won’t be properly configured, because it doesn’t know when to fire (and set the configuration variables from the DTM UI). The workaroud is to manually call the initialization of the Tool just before the synchronization code:

for (var toolid in _satellite.tools) {
    if (_satellite.tools[toolid].settings.engine == "sc") {
        _satellite.tools[toolid].initialize();
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *