Skip to content

Instantly share code, notes, and snippets.

@ianhampton
Created January 9, 2018 09:26
Show Gist options
  • Save ianhampton/9c7d2519489ccff923ea8c620b3ab4eb to your computer and use it in GitHub Desktop.
Save ianhampton/9c7d2519489ccff923ea8c620b3ab4eb to your computer and use it in GitHub Desktop.
// Configure new account/profile/environment details
var newAccount = "ianhampton";
var newProfile = "demo";
var newEnvironment = "prod";
try {
// Dynamically update environment
newEnvironment = document.querySelector('script[src*="tiqcdn.com"]').src.toString().split('/')[6];
} catch(e) {}
// Build new profile URL
var newProfileUtag = '//tags.tiqcdn.com/utag/'+newAccount+'/'+newProfile+'/'+newEnvironment+'/utag.js';
try {
(function() {
function ul(src, a, b) {
a = document;
b = a.createElement('script');
b.language = 'javascript';
b.type = 'text/javascript';
b.src = src;
a.getElementsByTagName('head')[0].appendChild(b);
}
if (newProfile !== "") {
ul(newProfileUtag);
utag_condload = true;
}
})();
} catch (e) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment