Before you start
Create a free Cool Analytics account and add your site. You'll get a site ID — replace YOUR_SITE_ID in the code below with it. The dashboard shows the snippet with your ID already filled in.
Install on Google Tag Manager
- 1In your GTM container, go to Tags → New → Tag Configuration → Custom HTML.
- 2Paste the snippet into the HTML box.
- 3Set the trigger to All Pages (Initialization – All Pages also works), save, then Submit and Publish the container.
<script defer src="https://coolanalytics.dev/hb.js" data-site="YOUR_SITE_ID"></script>
Check that it works
Open your live site in a new tab, then open your Cool Analytics dashboard. Your visit appears on the live map within seconds — with the page you're on, where you came from and your browser.
Nothing showing up? Make sure you're looking at the published site (not a preview or editor), that an ad blocker isn't blocking the script, and that you're not testing on localhost.
Track signups, purchases and clicks
Pageviews, sources, countries and outbound link clicks are tracked automatically. For the moments that matter to you, send a custom event. Events named like a signup show up as signups, and events with an amount show up as revenue — on the live map and per traffic source.
// anywhere in your Google Tag Manager site's browser code
window.hb?.track("signup");
// with an amount, it shows up as revenue
window.hb?.track("purchase", { amount: 49 });Google Tag Manager tips
- You don't need a History Change trigger for single-page apps — the script tracks route changes itself.
- Ad blockers that block GTM will block every tag inside it. Adding the snippet directly to your site is more reliable.
- Use GTM's Preview mode to confirm the tag fires, then check your live dashboard.
Want to keep your own visits out of the stats? Open your site once with #hb-ignore at the end of the URL. That browser is excluded until you visit with #hb-track.
Google Tag Manager analytics FAQ
Do I still need a cookie banner if I use GTM?+
Cool Analytics itself sets no cookies. Whether your other GTM tags need consent depends on what they are.
Can I send GTM events to Cool Analytics?+
Yes. Create another Custom HTML tag with <script>window.hb && hb.track('signup')</script> and fire it on your conversion trigger.
Should I put it in GTM or directly on the site?+
Directly is better: fewer moving parts and less likely to be blocked. GTM is fine if you can't edit the site.