Add cookie-free, GDPR-compliant analytics to your Vue.js app in under 2 minutes. No consent banner required. Works with Vue 3 (Composition API and Options API) and Vue Router.
No credit card required and setup in minutes
Replace YOUR_SITE_ID with your Beam site ID from the dashboard.
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Vue App</title>
<script
defer
src="https://beam-privacy.com/js/beam.js"
data-site-id="YOUR_SITE_ID">
</script>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Place the defer script in <head> so Beam loads after your Vue app without blocking render.
// src/router/index.ts
import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
history: createWebHistory(),
routes: [/* your routes */],
})
// Fire a Beam pageview on every client-side navigation
router.afterEach((to) => {
window.beam?.track?.('pageview', { path: to.fullPath })
})
export default router
Vue Router handles navigation without full page reloads. The afterEach guard fires after every route transition — keeping Beam's Top Pages report accurate across all routes.
Use this checklist after publish so you know tracking is actually live in production.
Beam is cookie-free by design — no consent UI to build, no GDPR overhead for your Vue SPA.
Beam's tracking script is lighter than a single Vue component and adds no npm dependencies.
The afterEach guard captures every Vue Router navigation so your Top Pages report is complete.
No PII, no fingerprinting, no ad-tech — just page-level metrics your team can act on.
Start free, validate your first pageview, and then scale when traffic grows.