A developer is often the one asked to "add analytics" and the one who has to keep it working. The good version is short to install, never throws into the page, survives single-page navigation and ad blockers, and can be queried without opening a dashboard.
What developers usually need to do
- Install tracking in a framework without hurting performance.
- Record sign-ups and other actions, some from the browser and some from the backend.
- Make sure payments are linked to visits, across domains and devices.
- Keep tracking working behind ad blockers and a strict Content Security Policy.
- Give product and marketing their numbers without building reports.
The tools
| Need | Where |
|---|---|
| Install | A defer script tag, or the npm packages (@reveata/tracker, @reveata/next). Guides for Next.js, React, Vue, SvelteKit, Astro, Laravel, Django and more |
| Goals from the browser | reveata('goal', name, props) or data-reveata-goal attributes. See the JavaScript API |
| Goals from the server | The events command and API, with the visitor id from the browser |
| Payments | Checkout metadata from reveata.metadata(), or the Payments API for in-house billing |
| Users | identify after sign-in, reset on log out |
| First-party serving | Managed proxy with one DNS record, or your own proxy |
| CSP | The exact directives in Content Security Policy |
| Push | Signed webhooks for payments, refunds, goals, alerts and a daily summary |
| Pull | The REST API, the CLI and the MCP server |
Single-page apps are handled: the script records a pageview on every pushState, replaceState and back or forward navigation. Hash routes can be counted as pages too.
A sensible setup
- Install with the guide for your framework and verify the installation.
- Proxy the script through your own domain.
- Pass
reveata.metadata()into checkout creation on the server. The revenue attribution guide has code per provider. - Call identify on sign-in and reset on log out.
- Send goals that are confirmed on the server (email verified, first API call succeeded) from the backend, so they cannot be faked from the browser.
- Add exclusions for staging hosts and your own IP. Pages on
localhostand127.0.0.1are ignored already, unless the snippet hasdata-allow-localhost="true".
What to keep an eye on
- The visitors per day drop below alert, which catches a removed snippet or a broken deploy.
- Why events don't show up, which lists every reason an event can be skipped or dropped.
- Unattributed payments; a rising share often means the checkout stopped passing the visitor id.
Honest limits
- No call throws into your page, but goals sent before the script loads are lost unless you add the queue snippet.
- Navigation started from code (
window.location) to another domain carries no cross-domain id; usereveata.decorate(url).