Integrate Vemetric using Google Tag Manager

Easily integrate Vemetric using Google Tag Manager.


Google Tag Manager is a popular tool for managing and deploying other scripts into you website.

Below you can find a step by step guide on how to integrate Vemetric using Google Tag Manager.

Installation

Create a new tag

Create a new tag in your Google Tag Manager container and select Custom HTML as the tag type.

Screenshot of specyfing the tag type in Google Tag Manager

Add the code snippet

Paste the following code snippet into the HTML input field:

<script>
  window.vmtrcq = window.vmtrcq || [];
  window.vmtrc = window.vmtrc || function (){window.vmtrcq.push(Array.prototype.slice.call(arguments))};

  var script = document.createElement('script');
  script.src = "https://cdn.vemetric.com/main.js";
  script.defer = true;
  script.id = 'vmtrc-scr';
  script.dataset.token = 'YOUR_PROJECT_TOKEN';
  document.getElementsByTagName('head')[0].appendChild(script);
</script>

Replace YOUR_PROJECT_TOKEN with the unique token for your project (found in the project settings).

Configure triggering

Configure the tag to fire on All Pages.

Screenshot of specyfing the tag trigger in Google Tag Manager

Verify installation

After saving and publishing your container in Google Tag Manager, Vemetric will automatically start tracking page views on your site (each page load will be recorded). You can verify this by checking your Vemetric dashboard for incoming pageview events a few seconds after loading a page

Data from localhost won’t be tracked.

Keep in mind that one project can be used to track data from multiple websites, which can be useful when you for example want to track users across your landing page and web application. We’ve also created a guide on how to track data across subdomains.

Vemetric’s snippet will initialize a global function window.vmtrc for tracking events and other functionality. See the Tracking Custom Events or User Identification sections for more details.

Further integrations

Checkout the HTML Script Docs to see which options are available and how to send custom events or identify users.

Get started by integrating Vemetric into your project.

Easily integrate Vemetric into your Next.js application.

Ready to understand your users?

Start tracking
Pricing About Documentation Changelog Blog