Install with Google Tag Manager
Load Graytower on every page through a Google Tag Manager Custom HTML tag.
Updated 2026-11-13
If your site already uses Google Tag Manager (GTM), you can load Graytower through it instead of editing your site's code.
Create the tag
- In Google Tag Manager, open your container and go to Tags → New.
- Name the tag, for example "Graytower".
- Choose Tag Configuration → Custom HTML.
- Paste the code below. Replace the domain and write key with the values from your snippet in Website → Settings → Tracking.
HTML
<script> (function () { var s = document.createElement("script"); s.defer = true; s.src = "https://graytower.app/js/script.js"; s.setAttribute("data-domain", "yourdomain.com"); s.setAttribute("data-write-key", "YOUR_BROWSER_WRITE_KEY"); s.setAttribute("data-gt-batch", "true"); document.head.appendChild(s); })();</script>If you use cookieless tracking, use script.cookieless.js instead of script.js. If your snippet has a data-allowed-hostnames line, add it the same way.
- Under Triggering, choose All Pages (or Initialization – All Pages to load it earlier).
- Save, then Submit and Publish the container.
Check it's working
- Use GTM's Preview mode to confirm the tag fires on your live domain.
- In Graytower, open Website → Settings → Tracking and look for Receiving events. See Verify tracking.