viakite
Dashboard

Guides/Get started/Quickstart

Quickstart

Your first page view in five minutes

Viakite Analytics counts page views, engaged time, scroll depth, outbound links and file downloads from one line of code. No cookies and no consent banner. This page takes you from sign-up to your first page view.

Using a coding agent?

Connect it to these docs with the MCP server, then ask it to install Viakite: claude mcp add --transport http viakite-docs https://docs.vk.viabio.me/mcp. Cursor and others: see Use the docs with AI agents. The dashboard's Install screen also has a ready prompt with your key filled in.

Before you start

You need a Viakite account and a project. Sign up at the dashboard; the first screen asks for your project's name and website, and gives you its public key, which starts with pk_live_. A project is one app or site; see Concepts.

Add Viakite to your site

  1. Add the script or the component

    Pick the way that fits your site. The script tag works on any site; the component is for apps built with a framework.

    index.html
    1<script defer src="https://us.api.vk.viabio.me/v1/a.js" data-project="pk_live_us_…"></script>
    app/layout.tsx
    1import { Analytics } from "@viakite/sdk/react";
    2
    3export default function RootLayout({ children }: { children: React.ReactNode }) {
    4 return (
    5 <html lang="en">
    6 <body>
    7 {children}
    8 <Analytics project="pk_live_us_…" />
    9 </body>
    10 </html>
    11 );
    12}
    src/App.tsx
    1import { Analytics } from "@viakite/sdk/react";
    2
    3export function App() {
    4 return (
    5 <>
    6 <Analytics project="pk_live_us_…" />
    7 {/* your routes */}
    8 </>
    9 );
    10}
    App.vue
    1<script setup lang="ts">
    2import { Analytics } from "@viakite/sdk/vue";
    3</script>
    4
    5<template>
    6 <Analytics project="pk_live_us_…" />
    7 <RouterView />
    8</template>
    src/routes/+layout.svelte
    1<script>
    2 import Analytics from "@viakite/sdk/svelte";
    3 let { children } = $props();
    4</script>
    5
    6<Analytics project="pk_live_us_…" />
    7{@render children()}

    With a framework, install the package first: npm install @viakite/sdk.

  2. Deploy, then open your site

    Nothing is sent from localhost, 127.0.0.1 or file://. To try it on your machine, add data-localhost (or the localhost prop).

  3. Watch it arrive in Realtime

    Open Realtime in the dashboard. Your visit shows within a few seconds. The Install page in the dashboard also waits for your first event and says when it arrives.

Send your first event

Page views come on their own. For what matters to your business, send an event:

checkout.ts
1import { track } from "@viakite/sdk";
2
3track("Signup", { plan: "pro" });

With the script tag the same call is on window: viakite.track("Signup", { plan: "pro" }). Then turn it into a goal to count conversions.

Seeing nothing?

Add data-debug to the script (or the debug prop) to see each event in the browser console without sending it. More in Debugging.

Next steps