Install DataPocket on Vue.js
Updated
Vue 3 + Vue Router, Nuxt, Vite. History-mode routing is tracked automatically. Sign in and these snippets fill in your site ID and domain. Until then, swap YOUR_SITE_ID and YOUR_DOMAIN with the values from your Install page.
- 1
Vite / Vue CLI: paste into index.html <head>:
html<script defer data-site-id="YOUR_SITE_ID" data-domain="YOUR_DOMAIN" src="https://datapocket.vo1d.studio/js/script.js" ></script> - 2
Hash-mode router (createWebHashHistory)? Use the hash build:
html<script defer data-site-id="YOUR_SITE_ID" data-domain="YOUR_DOMAIN" src="https://datapocket.vo1d.studio/js/script.hash.js" ></script> - 3
Nuxt: add it to nuxt.config.ts:
tsexport default defineNuxtConfig({ app: { head: { script: [{ src: "https://datapocket.vo1d.studio/js/script.js", defer: true, "data-site-id": "YOUR_SITE_ID", "data-domain": "YOUR_DOMAIN" }], }, }, });
Revenue attribution
- 1
Using another payment provider? Send payments from your backend (create an API key in Settings):
bashcurl -X POST https://datapocket.vo1d.studio/api/v1/payments \ -H "Authorization: Bearer dpk_…" \ -H "Content-Type: application/json" \ -d '{"amount": 29.99, "currency": "USD", "transaction_id": "order_123", "visitor_id": "<dp_vid cookie>"}'
Related guides
Next.jsApp Router or Pages Router. Client-side navigations are tracked automatically.
AstroStatic or server-rendered. Navigations with <ClientRouter /> (view transitions) are tracked automatically.
React RouterFramework mode (Remix) and library mode. pushState navigations are tracked automatically.
JavaScript appsReact, Vue, Svelte or Angular: the script tag with typed calls, plus server-side payments and goals over HTTP.
- AI crawler trackingSee when ChatGPT, Claude and Perplexity read your pages. One server-side call.
- All install guides25 platforms, code and no-code.