Do I need to change my backend code?
Do I need to change my backend code?
No. The Analytiq SDK runs entirely in the browser (frontend). Your backend — whether it’s Express, Django, Laravel, or anything else — doesn’t need any changes. The SDK sends events directly from the user’s browser to Analytiq’s server.
Can I test Analytiq without deploying my app?
Can I test Analytiq without deploying my app?
Yes. Just run your app locally with
npm run dev. Events sent from http://localhost will appear on your Analytiq dashboard in real time. No GitHub push or deployment needed — as long as your internet connection is working, it works.How long before I see data on the dashboard?
How long before I see data on the dashboard?
Within 5-10 seconds. Events appear on your dashboard in real time. There is no delay or batching — every
track() call is sent immediately and shows up within seconds.What is the API key? Is it safe to put in frontend code?
What is the API key? Is it safe to put in frontend code?
Your API key starts with
pk_live_ — the pk stands for “public key”. It is designed to be used in browser code. It’s safe to put it in your frontend without risk. It identifies your project, but does not give anyone access to your Analytiq account or your users’ data.What happens if I call track() before init()?
What happens if I call track() before init()?
The event is automatically queued in memory. The moment
init() is called, all queued events are sent immediately. You won’t lose any events.Does Analytiq work with TypeScript?
Does Analytiq work with TypeScript?
Yes, fully. TypeScript type definitions are built into the package — you don’t need to install
@types/analytiq. Just import { track } from 'analytiq' and TypeScript will auto-complete everything correctly.Will Analytiq slow down my app?
Will Analytiq slow down my app?
No. All network requests are asynchronous — they run in the background and never block your app’s UI. The SDK is also extremely lightweight (under 5KB).
Can I track users who are not logged in?
Can I track users who are not logged in?
Yes. You don’t have to call
identify(). Events without a user identity are tracked as anonymous visitors. You’ll see the events on your dashboard, just without a specific user attached to them.What if a user's internet goes down mid-session?
What if a user's internet goes down mid-session?
The SDK will retry the failed request once after 500ms. If the retry also fails, the event is dropped. Events are not persisted to disk — if the browser is closed before retry, the event is lost.
Where do I find my API key?
Where do I find my API key?
Log in to your Analytiq dashboard, click your project, click Settings in the sidebar, scroll to Public API Key, click Reveal, and then click Copy.
Can I use yarn or pnpm instead of npm?
Can I use yarn or pnpm instead of npm?
Yes. All three work identically with Analytiq:
- npm:
npm install analytiq - yarn:
yarn add analytiq - pnpm:
pnpm add analytiq
Can I use Analytiq without npm (plain HTML website)?
Can I use Analytiq without npm (plain HTML website)?
Yes. Use the CDN version — no npm or Node.js required. Paste this in your HTML:
Do I need to call init() on every page?
Do I need to call init() on every page?
No. Call
init() once in your root entry file (src/main.jsx for React, pages/_app.tsx for Next.js). It stays initialized for the entire session.What does reset() do exactly?
What does reset() do exactly?
reset() clears the user identity set by identify(), empties the event queue, and clears the deduplication cache. Call it when a user logs out so the next user’s events aren’t accidentally attributed to the previous user.Why do I see duplicate events on the dashboard?
Why do I see duplicate events on the dashboard?
The most common cause is calling
init() more than once. Make sure init() is only called in one place — your app’s root entry file. If your framework re-renders the root component multiple times, wrap init() in a check.