To add Obsidesk to a Vue or Nuxt app, put one script tag in index.html (Vue) or in the head config in nuxt.config.ts (Nuxt). You get visitors, routes, signups and revenue by channel once a revenue source is connected.
What you get
- Page views including Vue Router and Nuxt navigation
- Signups from forms with an email field
- Custom events with
window.obsidesk.track() - Revenue attribution with Stripe, Paddle, Polar or Whop
- No cookies
Set it up
- 1Create your account and add your domain
Sign up, add the domain you want to track and copy your site ID from Settings. Every plan has a 14-day money-back guarantee; there is no free trial.
- 2Vue: paste the script into index.html
Put it inside
<head>.<script defer src="https://obsidesk.com/script.js" data-site="YOUR_SITE_ID"></script>
- 3Nuxt: add it to nuxt.config.ts
Register the script through the app head.
export default defineNuxtConfig({ app: { head: { script: [ { src: "https://obsidesk.com/script.js", defer: true, "data-site": "YOUR_SITE_ID" }, ], }, }, }); - 4Deploy and verify
Open your site in a normal browser window and check that the visit appears in the live view. Visits on localhost are not counted unless you add
data-allow-localhost, and your own visits can be excluded by opening#obsidesk-ignoreonce. - 5Optional: npm package
Also available as
@obsidesk/analyticswithinject()formain.ts, but the script tag is enough.
Routing
The script follows history changes, so Vue Router and Nuxt route changes are page views. Use data-obsidesk-event="Pricing CTA" for no-code events.
Server-rendered Nuxt
The script only runs in the browser, so SSR output is unaffected. If you see no data, check that the site ID is set and that you are not testing from localhost.
FAQ
How do I add analytics to Nuxt?
Add the Obsidesk script to app.head.script in nuxt.config.ts with your site ID, then deploy.
Does it work with Vue Router?
Yes, route changes count as page views.
Can I track Stripe revenue from a Nuxt app?
Yes. Connect Stripe read-only and pass window.obsidesk?.id as client_reference_id in Checkout sessions. See the Stripe integration.
Works with
Connect Vue and Nuxt in about a minute.
14-day money-back guarantee. Installed in 30 seconds. Read-only revenue connections.