Cubius
Cubius

Reputation: 1334

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

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

Answers (2)

DanAntonson
DanAntonson

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

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

Upvotes: 0

Ol&#232;p
Ol&#232;p

Reputation: 449

The correct way to do it is explained in http://wiki.clicktale.com/Article/Google_Tag_Manager_Integration

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).

Upvotes: 1

Related Questions