Skip to content

Instantly share code, notes, and snippets.

@ianhampton
Last active June 19, 2017 14:42
Show Gist options
  • Save ianhampton/e6cc3c801d6e84fecd4931bf2fa1a9d7 to your computer and use it in GitHub Desktop.
Save ianhampton/e6cc3c801d6e84fecd4931bf2fa1a9d7 to your computer and use it in GitHub Desktop.
Always open Web Companion if Tealium is running
// ==UserScript==
// @name Always open Web Companion
// @namespace http://tealium.com/
// @version 0.1
// @description Always open WC if Tealium is running
// @author Ian Hampton
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
window.addEventListener('load', function() {
if (typeof window.utag.data !== 'undefined') {
if(typeof window.__tealium_tagcompanion=='undefined'){window.__tealium_tagcompanion=document.createElement('SCRIPT');__tealium_tagcompanion.type='text/javascript';__tealium_tagcompanion.src='//tags.tiqcdn.com/utui/utui.tagcompanion.js?v='+Math.random();document.getElementsByTagName('head')[0].appendChild(__tealium_tagcompanion);}
}
}, false);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment