takt

The snippet

One line of script, zero dependencies, ≈ 2.5 kB gzip. Paste it into the <head> and Takt starts measuring your pages — privacy-first.

Installation

Place the script as high as possible in the <head>, before your content. The defer attribute guarantees it never blocks rendering, and data-domain ties the data to the right site in your dashboard.

<script defer src="https://cdn.jsdelivr.net/npm/@vskstudio/takt-core/dist/takt.js" data-domain="example.com"></script>
The snippet automatically excludes localhost and private IPs, and respects Do Not Track. So in local development you won't see anything come through — that's expected.

As soon as it loads, Takt sends a pageview for the current page and then tracks every navigation after that, including inside a SPA (History API). You don’t need to wire anything else for basic audience measurement.

Tracking an event

Beyond page views, fire custom events from your code. The global window.takt(name, options) function is available immediately, even before the script has finished loading (calls are queued).

// A simple named event
window.takt('Signup')

// With properties to segment later
window.takt('Signup', { props: { plan: 'pro' } })

A few typical use cases:

Interaction

Clicking a CTA, opening a modal, submitting a form.

Revenue

Attach an amount to a purchase with $ to track revenue.

Journey

Onboarding or funnel steps to spot friction points.

Downloads

PDFs, exports, outbound links — enabled with a single data-* attribute.

What’s next