This article describes a method for setting up triggers (A.K.A load rules, A.K.A conditions) using a querystring parameter and a cookie. This is a useful method for testing a tag before it goes to production.
I recently ran into a situation where a variety of people across a few agencies needed to test a tag in production, but they didn’t want the tag active to the public at large. While most Tag Management systems provide tools for testing, the drawback when dealing with such a wide variety of people is that you have to explain how the testing tools work. This may include descriptions of tools to download, extensions to install, or other processes that are perhaps not intuitive to the non-technical user.
The solution I came up with is:
function() {
if (document.location.href.indexOf("baconDebug") > -1){
document.cookie = "baconDebug=true";
{{Bacon Debug Cookie}} = "true"
}
return "true";
}
Cookie Variable Config
Trigger Config
Load Rule Applied
The method described above was done in Google Tag Manager, but a similar approach would work for Tealium, Ensighten, and various other tag management systems.
This approach allows users with the cookie to view the tag without having to go use any of the testing tools Tag Management Systems might provide.
Join the Conversation...