Is there a way to setup Clicktale tag in Google Tag Manager?-Collection of common programming errors

Cubius,

I actually ran into the same issue and recently contacted ClickTale Support to find out the correct solution. I was given the following instructions which worked for me. Try the following:

1) Create a new tag in your GTM container.

2) Copy and paste the code into the new tag.

3) Change the general parameters in the code (PID, Ratio, PartitionPrefix) to your project’s details. For example (12345, 0.33, “www14”)

4) Save the new tag and publish the updated version of the container.

Here is the code:


function ClickTaleCreateDOMElement(tagName) {
if (document.createElementNS) {
return document.createElementNS('http://www.w3.org/1999/xhtml', tagName);
}
return document.createElement(tagName);
}
var ClickTaleIsXHTMLCompliant = true;
var ClickTalePrevOnReady;
if (typeof ClickTaleOnReady == 'function') {
ClickTalePrevOnReady = ClickTaleOnReady;
ClickTaleOnReady = undefined;
}
var ClickTaleOnReady = function() {
window.ClickTaleScriptSource = (document.location.protocol == 'https:'?
'https://clicktalecdn.sslcs.cdngc.net/www/':
'http://cdn.clicktale.net/www/');

window.ClickTaleIncludedOnDOMReady = true;
window.ClickTaleSSL = 1;

ClickTale(PID, Ratio, PartitionPrefix);

if(typeof ClickTalePrevOnReady == 'function') {
ClickTalePrevOnReady();
}
};
(function() {
var div = ClickTaleCreateDOMElement("div");
div.id = "ClickTaleDiv";
div.style.display = "none";
document.body.appendChild(div);

var externalScript = ClickTaleCreateDOMElement("script");
externalScript.src = document.location.protocol == 'https:'?
'https://clicktalecdn.sslcs.cdngc.net/www/WRe1.js':
'http://cdn.clicktale.net/www/WRe1.js';

externalScript.type = 'text/javascript';
document.body.appendChild(externalScript);
})();