Install Piqo on Vue.js

One snippet in index.html plus a router hook for client-side navigation.

  1. Paste the snippet into index.html inside the <head>.
  2. If you use Vue Router, fire a pageview on afterEach.
  3. Run npm run build and deploy.
<!-- index.html -->
<script defer data-site="YOUR_SITE_ID" src="https://piqo.app/piqo.js"></script>
// src/router/index.js
import { createRouter, createWebHistory } from 'vue-router';

const router = createRouter({
  history: createWebHistory(),
  routes: [/* ... */],
});

router.afterEach(() => {
  window.piqo && window.piqo('pageview');
});

export default router;
Nuxt users: add the script tag via your nuxt.config.ts under app.head.script.