Installing Your Tracking Script
To start collecting data with GoodMetrics, you’ll need to install a small tracking script on your website. This script allows us to track pageviews and custom events in real time.
Here’s how to get set up:
Step 1: Get Your Tracking Script
To retreive your unique tracking script:
- Log in to your GoodMetrics account.
- Click the settings icon (⚙️) in the left sidebar.
- Click View Code.
- Copy the script provided.

Step 2: Install the Script
To install the GoodMetrics script, copy your unique tracking code and add it to your website. We recommend placing it in the <head>
section.
Your tracking script will look something like this:
<script id="gmScript" data-gm="vzSjLph5nO5By4qK" src="https://cdn.goodmetrics.io/goodmetrics.min.js"></script>
💡 This is just an example. Your
data-gm-id
will be different so make sure to copy your script tag from your site settings.
Google Tag Manager (GTM) Installation
If you're using Google Tag Manager (which we don't recommend), you'll need to follow these steps instead:
- Open your GTM account.
- Create a new Custom HTML tag.
- Paste the following code and replace the
script.dataset.gm
ID with your uniquedata-gm
ID:
<script>
var script = document.createElement('script');
script.id = 'gmScript';
script.dataset.gm = 'qaWsoRPhDZoCcfUo'; // Replace with your unique website ID
script.src = "https://cdn.goodmetrics.io/goodmetrics.min.js";
script.defer = true;
document.getElementsByTagName('head')[0].appendChild(script);
</script>
- Set the trigger to All Pages.
- Save and publish your tag.
Verifying Your Script Installation
After installing the script, follow these steps to confirm it’s working:
- Visit the website where you installed the tracking script.
- Log in to your GoodMetrics dashboard.
- Go to the Realtime report.
- Confirm that your visit appears in the report.
If you don’t see your visit:
- Review the steps above and verify that you copied your script correctly.
- Double-check that the script is placed in the
<head>
section of your website. - Still stuck? Contact us and we’ll be happy to help.