Reputation: 1334
Since GTM doesn't support document.write() method the standard clicktale code doesn't work. Is there a workaround for this?
ClickTale employee has sent me these instructions:
Replace the document.write JS line above with the following:
document.body.appendChild(externalScript);
Example:
<!-- ClickTale Bottom part -->
<script type='text/javascript'>
var externalScript = document.createElement('script');
var scrSrc = document.location.protocol=='https:'?
'https://clicktalecdn.sslcs.cdngc.net/':
'http://cdn.clicktale.net/';
scrSrc += 'www11/ptc/xxx-xxx-xxx-xxx.js';
externalScript.src = scrSrc;
externalScript.type = 'text/javascript';
document.body.appendChild(externalScript);
</script>
<!-- ClickTale end of Bottom part -->
I am not sure what to do with this. Has someone tried something like this?
Upvotes: 1
Views: 1428
Reputation: 33
The above answer will work, but Google Tag Manager does have a template for ClickTale now, I always try to refrain from using the Custom HTML tag because this can absolutely break your site if done incorrectly
To set up ClickTale within GTM
Upvotes: 0
Reputation: 449
The correct way to do it is explained in http://wiki.clicktale.com/Article/Google_Tag_Manager_Integration
The procdeure is:
I tried it and it worked. Anyway I had to wait 24h (probably it's the time that Google needs for publishing the tag).
Upvotes: 1