window.tinyanalytics; you do not need an API key or a custom HTTP client.
Available event methods
The tracker automatically records initial pageviews and SPA route changes by default. Call
pageview() yourself only when you have disabled automatic pageviews or need to supply a custom
path.
Send a custom event
Callevent() after the tracking script has loaded:
string
required
A short, stable event name such as
signup or checkout_completed. An empty name is rejected in
the browser.object
Optional JSON properties used for breakdowns and filters. The serialized object can be up to 8
KB.
checkout_completed event with a plan property instead of a separate event name for every plan.
Attach revenue
Put the reservedrevenue and currency properties on a custom event:
revenueaccepts a positive number or numeric string in major currency units.currencyis a three-letter currency code such asUSD,EUR, orGBP.
Send a manual pageview
Automatic pageviews and SPA route tracking cover most sites. If you turn automatic pageviews off, send one when your app finishes navigation:Send an outbound-link event
Outbound links are captured automatically by default. UsetrackOutbound() when your app opens an
external destination without a normal anchor click:
Track a handled error
Automatic error capture sees uncaught errors when you enable it. UsetrackError() inside a
catch block or error boundary for an error your app handles:
Call the API after the script loads
The script loads withdefer, so event handlers and app lifecycle callbacks can call it normally.
Guard code that may run during early page boot:
Verify
1
Trigger the browser call
Open your site in a browser and perform the action that calls
event(), pageview(),
trackOutbound(), or trackError().2
Check the matching report
Open Events for custom and outbound events, Pages for pageviews, or Errors for
JavaScript errors. The new record should appear within a few seconds.
The client-side integration is working when the browser action appears in its matching
TinyAnalytics report.
Related
Custom events
Design stable event names and useful properties.
Browser identity
Identify signed-in users and update traits from client-side code.
Configure the tracking script
Control automatic pageviews and capture options.
Verify installation
Diagnose script loading and event delivery.