Add it to a website
Add your site in Statiku, then paste its line into every page you want to count, just before </head>. Each site has its own key (p_…); Statiku shows yours, with steps for WordPress, Shopify, Wix, Squarespace, Webflow, Framer and Google Tag Manager.
<script defer data-project="p_…" src="https://statiku.com/s.js"></script>
Page views count on their own, including the pages of a single-page app. The live view shows a visitor the moment they arrive, and the site's card turns green with its first visit. The script is under 10 KB.
The script's options
| Attribute | What it does |
|---|---|
data-project | The site's key. Required. |
data-api | Send events to another address, such as a path on your own domain that forwards to https://statiku.com/e. |
data-hash | Count #/routes as pages, for apps that route with the hash. |
data-local | Count visits on localhost too, while you try it out. |
data-lite | Page views and events only: no heatmap clicks, scroll depth, page speed or script errors. |
To leave your own visits out, run localStorage.statiku_ignore = "1" in your browser's console on your site.
Events and clicks
Anything a visitor does can be an event, with up to 30 properties:
<script>
window.statiku = window.statiku || function () { (statiku.q = statiku.q || []).push(arguments) };
statiku("signup", { props: { plan: "pro" } });
</script>
Or without writing code, on any link or button:
<a href="/pricing" data-track="pricing" data-track-from="hero">Pricing</a>
Some clicks count by themselves: a click on a file (.dmg, .pkg, .zip, .exe, .msi, .apk and the like) sends download, and a click on a Stripe or Polar checkout link (buy.stripe.com, buy.polar.sh) sends checkout, with a reference added to the link so the payment can be credited to the visit.
Which events count as goals (conversions) is up to you, in the site's settings. Without a list of your own, sign-ups, trials, purchases, orders, checkouts, downloads and installs do, and so does anything that earned money.
Revenue and sales
An event can carry what it earned, in any currency:
statiku("purchase", { revenue: { amount: 29, currency: "EUR" } });
Or let your payment provider tell Statiku: in the site's settings, under Payments, connect Stripe (checkout.session.completed) or Polar (order.paid) with the webhook address and signing secret shown there. Each payment is then counted once, as a purchase from the source, campaign and page of the visit whose checkout click carried its reference. Payments without one still count, as "Not matched".
Trackers
A tracker follows anything else: installs, sales, a score, a sensor's reading, a server's status. Each value is a number, a word or a yes/no, sent from a script, a server or a device with the site's secret key, from Add tracker in Statiku:
curl https://statiku.com/v1/track \
-H "Authorization: Bearer sn_…" \
-d '{"name": "Sales", "value": 29, "op": "add", "labels": {"plan": "pro"}}'
| Field | What it is |
|---|---|
name | The tracker. A new name starts a new tracker. |
value | A number, a word ("Online") or a yes/no (true). |
op | "add" for a number that counts up (each value is added to its total). Anything else keeps its latest value. |
ts | When it happened, as ISO time or Unix seconds. Leave it out for now. |
labels | Up to ten labels ({"plan": "pro", "country": "FI"}) to split the tracker by. |
A call can send up to 100 values as {"values": [...]}, and a site up to 1,200 a minute. A device that can only open an address can use https://statiku.com/v1/track?key=sn_…&name=Temperature&value=21.5. Values also come in CSV files: a row each with time, name and value columns (any other column is a label), or a time column and a column for each tracker.
Keep the key on servers and devices: on a web page anyone could read it, and for what visitors do there are events. Each tracker has a page of its own: a line, an area, bars, a pie or a table, by the hour, day, week or month, as a total, an average, the lowest, the highest or the latest, against the period before and split by any label; for words, how often and how long each value was.
Apps (Swift)
The Swift package (macOS 12 and iOS 15 or later) follows each install from the download that led to it to the trial and the licence:
import Statiku
Statiku.start(project: "p_…") // when the app launches
Statiku.setState(.trial) // .trial, .expired, .licensed or .free
Statiku.track("export", ["format": "png"])
NSWorkspace.shared.open(Statiku.checkoutURL(buyURL)) // so a purchase is credited to the install's source
Statiku.isOptedOut = true // an opt-out in your app's settings
The first launch sends install, each day the app runs sends active, and a new version sends update. An install is matched to the website visit whose download came from the same network in the day before; that match is an estimate.
TV view and sharing
Each site's TV view is a live board for a screen on the wall or a launch day: who's on the site now and on which page, today's visitors, conversions and takings, your trackers, momentum, and a running commentary, with a moment for every sale. Share it at a link of its own (Share, in the TV view): anyone with the link sees the board and nothing else, and you can turn the link off at any time.
Alerts and reports
Statiku emails a site's owners when it goes quiet (and says whether it's down, lost its tracking code or just has no visitors), when visits come back, and when a rush arrives. Every Monday morning a weekly report compares last week with the week before, by email and, with an incoming webhook from Slack, in a channel. Each can be turned off in the site's settings.
Importing history
On a site's Import history page: sign in with Google to bring Google Analytics 4, use a Plausible Stats API key, follow a GitHub repository's release downloads, or drop in CSV or ZIP files from Fathom, Matomo, Umami, Simple Analytics and other tools. Imported days fill in your reports for the time before Statiku started counting.
Your visitors' data
The data is kept in the EU. What Statiku collects about visitors, how long it keeps it and who else is involved are in the privacy policy; the terms you and Statiku agree to as your processor are in the data processing agreement. Questions: contact@victorabuchi.com.