Docs

Analytics

Every hosted app gets one first-party counter, and the numbers belong to the owner: no cookie, no stored IP address, and no vendor script on your visitors’ pages.

Agent tools

  • siteAnalytics
  • setSiteAutoInject

One counter per app

The key is public — tfsk_ plus 32 hex characters — and names the project and the origins allowed to report for it. The Analytics section shows the numbers, and siteAnalytics reads them for your agent; the first read for an app that has no counter yet issues its key.

Adding it

Paste one line into the app's page:

your page’s HTMLhtml
<script defer src="https://trytofu.ai/collect.js" data-site="tfsk_…"></script>

Or let Tofu add it. Automatic injection is off by default and is one switch per project (the Analytics section, or setSiteAutoInject). With it on, a prebuilt static deployment gets that same line added to its root index.html at deploy time — a script from Tofu's domain in your visitors' pages, which is why the switch asks first. It never edits the files you uploaded, and switching it off and deploying again removes the line.

A deployment Tofu has to build — a framework app — never gets the line, because its source index.html is not the page that is served: add the line to the app's own template.

What is not collected

  • No cookie.

    Nothing is written to the browser, so there is no identifier to clear and no banner to show for one.

  • No vendor script.

    One small script from Tofu’s own domain, reporting to Tofu. Nothing about a visitor leaves Tofu’s infrastructure.

  • No stored IP address.

    A day-salted digest only when a salt is configured; otherwise unique visitors show as —.

  • Do Not Track and GPC.

    Both are honoured, in the browser and again on the server, before anything is derived from the visit.

Query strings and fragments are stripped before anything else reads the address, and the path is reduced: a segment that looks like an id is stored as :id.

Retention

Retention defaults to 90 days, is capped at 365 and is enforced by a daily prune; deleting a project deletes its key and its traffic. An app's counter is never sampled: the numbers you see are every view it recorded.

Limits

What analytics does not count

The collector under-counts by design.

  • One view per page load. A move inside a single-page app that does not load a page is not a new view.

  • Crawlers count like people.

  • Floods are braked. A per-site-and-address brake at 600 requests a minute, and one shared platform budget, refuse what is over them.

  • No export yet. The numbers are read in the dashboard or by your agent.

Early access · every preview is labelled in your dashboard.