Google Tag Manager Module for SilverStripe

2.0.3 2019-08-02 10:42 UTC


SilverStripe module to add Google Tag Manager code to all pages of a website.


Download, clone or install from packagist (todo) into your Silverstripe root. Visit

What does it do?

The module will output the following code to <head>...

<!-- Google Tag Manager -->
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
<!-- End Google Tag Manager -->

... and the following code just after <body>

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src=""
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

GTM-XXXX will be replace by a ContainerID which can be configured in Site Settings > Google Tag Manager


  • Add support for passing in data layers