Install Piqo on Vue.js
One snippet in index.html plus a router hook for client-side navigation.
- Paste the snippet into
index.htmlinside the<head>. - If you use Vue Router, fire a pageview on
afterEach. - Run
npm run buildand 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.