You are here

GTM Setup

To operate santiano.io, you need to make sure Google Tag Manager is implemented correctly with your website.

You need in this specific order in your HTML:

  • a static dataLayer : holding all static variables
  • the First GTM script
  • the Second GTM noscript
  • and then after all the custom dataLayer.push({});

Managing GTM Ids

You will need to replace the code : 'GTM-XXXXX' with the ID of your container in GTM

You can also define two Container IDs with santianoCore and manage 1 configuration JSON file on two container ids one for prod, one for dev.

ON 100% of all pages of your site

___________________________
###########################
Our GTM Code implementation
Needs a very specific order
###########################
___________________________


<!doctype html>
<head>
<!-- On Top Right after the opening of the of the head -->
	<script> // Static DataLayer -->
	dataLayer = [{
		// All static to the page dataLayer variables 
	}]
	</script>

    <!-- Google tag manager JS snippet -->
	<script>
	(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
	new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
	j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
	'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
	})(window,document,'script','dataLayer','GTM-XXXXX');
	</script>
    <!-- End of the JS Google Tag Manager -->

<!-- All the rest of the tags in the HEAD -->

</head>
<body>
<!-- Right after the opening of the body -->
	<!-- NoScript iframe Google Tag Manager (noscript) -->
	<noscript>
		<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXX"
	height="0" width="0" style="display:none;visibility:hidden"></iframe>
	</noscript>
	<!-- End of NoScript iframe for Google Tag Manager -->



	<!-- All dataLayer.push Functions are loaded in the body of the page -->
	<!-- Do not include the GTM code in an external JS as this would not work -->

	<script>
	dataLayer.push({});
		// before you shoot a dataLayer.push() function, please make sur its content is complete
	</script>

</body>

 

 

 

Add new comment