Configuring Complianz for Server-side Tag Manager

Although server-side tag manager is relatively new we had some questions about how to proceed if you serve tags from the server-side, and not directly from the third-party domain googletagmanager.com. There are 2 domains to consider. In this example you will see the first domain that sets the tag, and the transport URL, that receives data.

In this case, it’s both tagging.example.com, a self-managed server for both instances. It’s however possible to still serve the tags or container with googletagmanager.com or a dedicated Google Cloud solution and still hold another transport URL.

That being said, if you’re using server-side tagging, you probably understand the differences.

				
					<!-- Global site tag (gtag.js) - Google Analytics -->
<script type="text/plain" data-service="gtag" data-category="marketing" async data-cmplz-src="https://tagging.example.com/gtag/js?id=G-1234"></script>
<script type="text/plain" data-service="gtag" data-category="marketing">
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-1234', {
     transport_url: 'https://tagging.example.com',
     first_party_collection: true
  });
</script>

<!-- Global site tag (gtag.js with Consent (recommended) - Google Analytics -->

<script data-service="gtag" data-category="marketing" type="text/plain" data-category="statistics" async data-cmplz-src="https://tagging.example.com/gtag/js?id=G-1234"></script>
<script data-service="gtag" data-category="marketing" type="text/plain" data-category="statistics">
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-1234', {
     transport_url: 'https://tagging.example.com',
     first_party_collection: true
  });
</script>
				
			

Configuring Complianz

Complianz can add your GTM code automatically, but this is only available for standard implementation. If you want to use Complianz with your variation of server-side tagging.

Choose Google Tag Manager under “Statistics,” but make sure Complianz does not add the snippet. As shown in the below screenshots.

Afterwards you can add the desired snippet yourself and Complianz knows it should fire events through the data layer. To further  configure Tag Manager, please read this article

Need support for Google Consent Mode V2, or TCF? Start here with our dedicated support team.

Join 1 Million users and install The Privacy Suite for WordPress locally, automated or fully customised, and access our awesome support if you need any help!