Overview
Analytics and ad attribution for TypeScript and JavaScript apps.
One install in a TypeScript or JavaScript app. Pageviews, clicks, forms, time on page and ad attribution are captured for you.
npm i @vibiz/analyticsimport { init } from '@vibiz/analytics';
init({ orgId: 'org_xxx' });What it does
The job is not counting pageviews. It is capturing the identifiers an ad platform needs to attribute a sale, at the only moment they exist, and delivering the real revenue back so optimisation has something true to learn from.
page_view | Every load, and every route change in a single page app. |
page_left | Time on page, total and active, plus scroll depth. |
click | On links and buttons, with the element described. |
rage_click | Three hits on one element inside a second. |
lead | Every form submit, with the contact details the visitor typed. |
attribution | Every UTM tag and click id on the landing URL, plus Meta identifiers. |
Do not send these by hand
Adding your own pageview or click tracking on top will double count every one of them.
Why the tag has to be there first
_fbc, Meta's click id, exists only in the URL of the ad click, for the length
of one page load. If nothing captures it there, no backfill, no CRM export and
no support ticket will ever produce it. Everything else can be added later.
Install
Next.js, React, or Node on the server.
Events
What to send, and what is already sent for you.
Identify
Attach a person, and your onboarding answers, to a visitor.
Consent
Advertising consent, and what is kept readable vs hashed.
Verify
Prove it works, and diagnose it when it does not.
Install with an agent
Paste-ready prompt for Cursor, Claude Code, Codex.