All Collections
Questions and answers
Getting Started
Can I Place The Code Inside My Google Tag Manager?
Can I Place The Code Inside My Google Tag Manager?

Can the Datacrushers code be placed inside my Google tag manager? How do I do I place it?

Gilad Sugarman avatar
Written by Gilad Sugarman
Updated over a week ago

Sure you can! 

We have many clients using GTM to manage their sites. There is a slight adjustment that you'll need to apply to your unique Datacrushers script before pasting it into your site. This is due to syntax constraints in the tag manager itself, but don't worry! It works just fine.

Here is an example of our actual script generated in the Get Code tab of our dashboard:

<script type="text/javascript">

var pkBaseURL = (("https:" == document.location.protocol) ? "https://" : "http://");

document.write(unescape("%3Cscript src='" + pkBaseURL + "ADDRESS_OF_YOUR_SCRIPT_HERE' type='text/javascript'%3E%3C/script%3E"));

</script>

Before you place the script into the tag manager, you must take the ADDRESS_OF_YOUR_SCRIPT_HERE string and paste it in.

<script>
var tag = document.createElement('script');
var pkBaseURL = (("https:" == document.location.protocol) ? "https://" : "http://"); tag.src = pkBaseURL + "ADDRESS_OF_YOUR_SCRIPT_HERE "; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(tag, s);
</script>




If you run into any issues, or if this looks like Greek to you, we have your back. Open a ticket and we will be happy to help you with the implementation.

Did this answer your question?