Skip to main content
Before starting: Get your API key from the Settings page

Step 1 — Install the SDK


Step 2 — Initialize in src/main.js (One-time setup)

Open src/main.js. This is the only file you need to change for the core setup. Add the init() call before you mount the app.
src/main.js
Add your API key to .env:
That’s the core setup! You can now track events from anywhere in your app.

What the SDK handles automatically


Step 3 — Identify users and reset on logout

Vue doesn’t use hooks, so you call identify() and reset() directly. The best place is your Pinia store or auth composable:

Step 4 — Track Custom Events

For specific actions (button clicks, purchases, etc.), import track() in any component:
src/components/PricingCard.vue

Step 5 — Verify it’s working

  1. Run: npm run dev
  2. Open your browser, Press F12 and go to Console
  3. You should see:
  1. Navigate between pages in your app
  2. Go to your Analytiq DashboardEventspage_view events appear within 10 seconds.