My First Love Letter to DTM Switch

How do I love thee?

Inspired by Tina Fey’s love letters to Amy Pohler, I am posting my own first love letter dedicated to my favorite Chrome Plugin: DTM Switch. This is a simple technology that lets you take your unpublished changes within your TMS (Tag Management System) for a local test drive on your live sites.
tina-fey_amy-poehler-love
craig-scribner_DTM-love
Adobe’s Dynamic Tag Manager (DTM) has the same basic structure as other TMSs, i.e., it maintains two sets of tag management instructions: a staging version and a production version.
Your unpublished pages and sites should all reference the staging version, which you can tweak and test and revise without affecting your live sites. Publishing the staging version of your TMS is done as part of your wider release, and should be subject to the same rigorous QA process.
But TMS updates aren’t necessarily tied to major site releases. In fact, the primary selling feature of TMS technology is that you can bypass the slow lane of code deployments and make changes to your marketing tags that need to be fixed asap.
Last week I met a Data Governance director for an enormous website who publishes a DTM update every couple of weeks. I can imagine the panic he must feel every time he presses the Publish button. Even when my technology teams assure me that there’s no difference between staging and production, I’ve lived too long in this space and seen that promise broken too many times to feel comfortable relying upon their word. Also, it affects me more than them, since I’m the one that’s going to have to deal with the aftermath, not just of identifying and fixing any mistakes, but of having to adjust reports for weeks and months to come.

Adobe DTM Switch by SearchDiscovery

Enter DTM Switch: the simplest little widget that lets you browse around your live website with one tiny difference: the “-staging” suffix is injected into the JS filename on every page. Essentially, it pushes your staging TMS library to the live environment, but just for you, and only on your browser. It stays that way until you switch it back.
This works reliably because Adobe’s hosted DTM libraries follow this format:
//assets.adobedtm.com/4815162342bobloblaw.js
//assets.adobedtm.com/4815162342bobloblaw-staging.js

Try DTM Switch out yourself

DTM Switch might only be available for Chrome and Firefox browsers, but you can achieve the same result anywhere by typing this javascript command directly within your browser’s console:
localStorage.setItem('sdsat_stagingLibrary', true);
I threw together this little example that you can check out yourself.
This is a little pretend-site that I use for analytics implementation training.
edge-screenshot-main
Turn on your debugging tool of choice (Charles, Fiddler, ObservePoint, WASP, Ghostery, etc.) and review the Adobe/Omniture tag that fires when you load the page.
Now click on one of the people. Notice how nothing new is sent to Adobe? That’s something I decided to add using my TMS, but I haven’t published the new code yet.
In DTM Switch, turn the Staging button to ON. If you don’t want to install DTM Switch onto your browser, just press F12 and in the Console, type the javascript line I included above. Then refresh the browser, and the page will indicate that the Staging server is active.
Now look the tag that is sent when you click on one of the people.
staging-call-preview-in-production
Here you’re seeing the calls that are about to start flowing into Adobe’s system as soon as you hit the Publish button in DTM. Everybody else in the world is seeing the other version, but you’re getting a sneak peek. It’s like test driving your updated TMS on actual streets instead of the closed circuit track of your staging environment.

Regression Tests and Automation

And the best news of all is that this line of code can be applied within programatic tag checks, like those offered by our partner ObservePoint.
Say you have a series of sanity/regression tests that you run periodically on your websites to make sure that the tracking is solid. Add this one line of code to the top of your simulations, and now those same tests will either give you the all clear, or warn you about something that you’re about to break, in time for you to fix it.

Author’s Note, 8/21/2015: My good friend Patrick Hillery just posted a terrific step-by-step tutorial on including the DTM Switch command within ObservePoint’s auditing and simulation tools. It’s not just DTM-specific either; he shows you how to do this for a variety of popular Tag Management Solutions.

Get Started

Find out why hundreds of customers use Claravine