HTML / Vanilla JavaScript
The simplest integration. Paste the script directly into your HTML.
Difficulty: Easy
Takes about 2 minutes
Step 1: Copy the script
Log in to Savri and go to your site. Click the "Tracking script" button to copy your unique script.
Step 2: Paste in <head>
Open your HTML file and paste the script inside the <head> tag, just before </head>.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>My site</title>
<!-- Savri tracking -->
<script defer
data-site-id="YOUR-SITE-ID"
data-api="https://savri.io"
src="https://savri.io/script.js">
</script>
</head>
<body>
<!-- Your page content -->
</body>
</html>Step 3: Upload
Save the file and upload it to your web server. The script will start tracking visitors immediately.
Multiple pages
If you have multiple HTML files, you need to add the script to each page you want to track. Alternatively, you can use a server-side include or template system.
Track custom events
You can track clicks and other interactions with the va() function:
<button onclick="va('event', 'Signup Click', { plan: 'pro' })">
Sign up
</button>
<a href="/product" onclick="va('event', 'Product View', { id: '123' })">
View product
</a>Tip
Use the defer attribute so the script loads asynchronously without blocking page rendering.
Need help?
See all integration guides → →