Debugging Helpers

Trying to troubleshoot Adobe Marketing Cloud solutions? Have no access to plugins? Don’t despair!

Below you’ll find a handy collection of code snippets that you can paste into your browser’s console and execute.

Hint: triple-clicking into the boxes should select the whole snippet.

DTM

Find out whether DTM is loaded, in staging mode or not, at what time your library was last built, and with which version of DTM:

if("object"!=typeof _satellite)console.log("No Adobe DTM JS library loaded");else{var a=_satellite,b="Adobe DTM JS library is present";"undefined"!=typeof a.settings&&a.settings&&"undefined"!=typeof a.settings.isStaging&&a.settings.isStaging&&(b+=" (staging library)"),"undefined"!=typeof a.appVersion&&a.appVersion&&(b+=" version "+a.appVersion),"undefined"!=typeof a.buildDate&&a.buildDate&&(b+=", latest build "+a.buildDate),console.log(b)}

This is what you’ll see:

[screenshot]
Chrome – a page w/o DTM
[screenshot]
Edge – a page with DTM
[screenshot]
Firefox – a page with DTM staging library

Marketing Cloud ID Service

Find out whether the Marketing Cloud ID Service library is loaded, and which version you are using:

"function"!=typeof Visitor?console.log("Adobe Marketing Cloud ID Service JS library not loaded"):"undefined"!=typeof Visitor.version?console.log("Adobe Marketing Cloud ID Service JS library version "+Visitor.version):console.log("Not sure whether Adobe Marketing Cloud ID Service JS library is present");

This is what you will see:

[screenshot]
Chrome – a page w/o Marketing Cloud ID Service
[screenshot]
Edge – a page with Marketing Cloud ID Service library loaded

Analytics

Find out whether the Analytics library is loaded, what type you use (s_code.js or AppMeasurement.js), and which version:

"function"!=typeof AppMeasurement&&"object"!=typeof s?console.log("No Adobe Analytics JS library loaded"):"function"==typeof AppMeasurement?console.log("Adobe Analytics JS library version "+(new AppMeasurement).version):"object"==typeof s&&"undefined"!=typeof s._c&&"s_c"==s._c?console.log("Adobe Analytics legacy JS library version "+s.version):console.log("not sure whether Adobe Analytics JS library is present");

This is what you’ll see:

[screenshot]
Chrome – a page w/o Analytics
[screenshot]
Firefox – a page with legacy H.xx.y Analytics
[screenshot]
Edge – a page with Analytics

Target

Find out whether the Target library is being loaded, which type you are using (mbox.js or at.js), and which version:

"undefined"!=typeof mboxVersion||"undefined"!=typeof adobe&&"undefined"!=typeof adobe.target?"undefined"!=typeof mboxVersion?console.log("Adobe Target legacy JS library version "+mboxVersion):"undefined"!=typeof adobe&&adobe&&"undefined"!=typeof adobe.target&&adobe.target&&"undefined"!==adobe.target.VERSION&&adobe.target.VERSION?console.log("Adobe Target JS library version "+adobe.target.VERSION):console.log("not sure whether Adobe Target JS library is present"):console.log("No Adobe Target JS library loaded");

This is what you’ll get:

[screenshot]
Chrome – a page w/o Target
[screenshot]
Edge – a page with legacy Target library (mbox.js)
[screenshot]
Firefox – a page with Target library (at.js)

Notes

These snippets can be used in almost any browser, and you don’t need any plugins, either.

For more resources around debugging, I would recommend the related article on this blog, Debugging, or the new installment, Debugging 2017.02.

I also made the Inofficial Adobe Marketing Cloud Debugging Cheat Sheet (PDF letter version), also available as an A4 version, which you can put up onto your wall:

[screenshot]
Inofficial Adobe Marketing Cloud Debugging Cheat Sheet