Installation

Get started by integrating Vemetric into your project.


In Vemetric, you can have multiple projects in your organization. After creating a project in Vemetric, you can choose between two installation methods to start collecting analytics data.

The simplest way to integrate Vemetric into any website.

For web applications, you can install Vemetric’s official NPM package for better TypeScript support.

HTML Script Tag

This method is the simplest way to integrate Vemetric into any website:

Include the Vemetric script

Copy the following code snippet into the <head> section of your website so that it loads on every page.

<script>
  window.vmtrcq = window.vmtrcq || [];
  window.vmtrc = window.vmtrc || function (){window.vmtrcq.push(Array.prototype.slice.call(arguments))};
</script>
<script defer src="https://cdn.vemetric.com/main.js" data-token="YOUR_PROJECT_TOKEN"></script>

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

Verify installation

Once added, 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.

Configuration

Checkout the corresponding docs page for the HTML Script for more details on configuration and available functions.

NPM Package

For web applications, you can install Vemetric’s official NPM package for better TypeScript support:

Install the Vemetric NPM package

In your project directory, run:

npm install @vemetric/browser

Initialize Vemetric

Import and initialize Vemetric in your application’s startup code (for example, in your main JavaScript entry file or within a React/Angular initialization):

import { vemetric } from '@vemetric/browser';

vemetric.init({
  token: 'YOUR_PROJECT_TOKEN',
});

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

Verify installation

Once added, 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.

For more sophisticated integrations, see the Tracking Custom Events or User Identification sections.

Configuration

Checkout the corresponding docs page for the Web (Browser) SDK for more details on configuration and available functions.


Congrats, now you’ve set up Vemetric. 🥳

Next, we’ll cover how to use the Dashboard to view and filter your analytics data, and how to send custom events.

Welcome to the Vemetric documentation.

Explore and understand your data with Vemetric’s interactive dashboard.

Pricing About Documentation Changelog Blog