Is there a way to setup Clicktale tag in Google Tag Manager?

Tag: web-analytics , web-analytics-tools , google-tag-manager Author: shinewhh Date: 2013-05-26

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: 

<!-- ClickTale Bottom part --> 
<script type='text/javascript'> 
var externalScript = document.createElement('script');
var scrSrc = document.location.protocol=='https:'?

scrSrc += 'www11/ptc/xxx-xxx-xxx-xxx.js';

externalScript.src = scrSrc;
externalScript.type = 'text/javascript';
<!-- ClickTale end of Bottom part -->

I am not sure what to do with this. Has someone tried something like this?

Other Answer1

The correct way to do it is explained in

The procdeure is:

  • Create a new container (or add the below to an existing container).
  • Create a new Custom HTML tag in your GTM container.
  • Copy and paste your project’s bottom code (from the ClickTale account) into the new tag.
  • Check the “Support document.write” checkbox.

I tried it and it worked. Anyway I had to wait 24h (probably it's the time that Google needs for publishing the tag).

Other Answer2

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

  1. New - Tag
  2. Certified Analytics
  3. ClickTale Standard Tracking.