This guide will walk you through setting up Vemetric and tracking your first events. By the end, you’ll have analytics running on your website or application.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/vemetric/vemetric/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, make sure you have:- A Vemetric account (or a self-hosted instance)
- A website or application where you want to track analytics
- Basic knowledge of JavaScript or your preferred framework
Choose Your Integration Path
Pick the integration method that best fits your stack:JavaScript
Vanilla JavaScript for any website
React
React applications and Next.js
Node.js
Server-side tracking
Self-Hosted
Deploy your own instance
JavaScript Setup
Perfect for static websites, WordPress, or any site where you can add a script tag.Get your project token
- Log in to your Vemetric dashboard
- Navigate to Settings → Projects
- Copy your project token (starts with
vem_)
Keep your project token secure. It will be visible in your frontend code, so only use it for tracking - never for API authentication.
Add the tracking script
Add this script tag to the Replace
<head> section of your HTML:your-project-token with the token from step 1.Configuration options
Configuration options
You can customize the tracking script with these data attributes:
data-token- Your project token (required)data-host- The ingestion endpoint (defaults tohttps://hub.vemetric.com)data-allow-cookies- Enable cookie-based tracking (default:"true")data-mask-paths- Mask sensitive URL paths (comma-separated list)
Verify tracking
- Open your website in a browser
- Open the browser console (F12)
- You should see a message:
Vemetric initialized - Go to your Vemetric dashboard
- Navigate to Dashboard → you should see your pageview appear within seconds
React Setup
For React applications, including Next.js, Remix, and Create React App.Add the VemetricProvider
Wrap your app with the
VemetricProvider:- React Router
- Next.js App Router
- Next.js Pages Router
Node.js Setup
For server-side tracking in Node.js applications.Next Steps
Now that you’re tracking events, explore these features:User Journeys
Visualize individual user paths through your product
Funnels
Analyze conversion rates and drop-off points
Custom Events
Track specific user actions and behaviors
Dashboard
Explore your analytics dashboard
Troubleshooting
Events aren't appearing in the dashboard
Events aren't appearing in the dashboard
Check these common issues:
- Verify your token - Make sure you’re using the correct project token
- Check the browser console - Look for any Vemetric-related errors
- Bot detection - Vemetric filters out bot traffic by default
- IP exclusion - Check if your IP is excluded in project settings
- Wait a moment - While events appear in real-time, there might be a brief delay
CORS errors
CORS errors
If you’re getting CORS errors:
- Make sure you’re using the correct
data-hostorhostvalue - For self-hosted instances, ensure your CORS configuration allows your domain
- Check that you’re using HTTPS (required for cookie-based tracking)
Events work in development but not production
Events work in development but not production
Common causes:
- Content Security Policy (CSP) - Add Vemetric domains to your CSP
- Ad blockers - Some ad blockers may block analytics scripts
- Environment variables - Verify your token is correctly set in production
Need more help? Check our troubleshooting guide or review the integration documentation.