Quickstart
- In the portal, add a site with your website's origin, such as
https://www.example.com. - Publish the DNS TXT record the portal shows, then choose Verify. Verification asks your domain's own nameservers, so it passes as soon as the record is published.
- Turn recording on in the site's Recording tab.
- Add the install snippet from the Installation tab to every page, and call the consent function from your consent banner.
Recordings appear under Recordings in the portal within seconds of a visitor agreeing.
Install and consent
Copy the snippet from the site's Installation tab: it names the current release and carries its Subresource Integrity hash and your site's public key.
<script async
src="https://analytics.ironfang.uk/sdk/0.1.1/loader.js"
integrity="sha384-..."
crossorigin="anonymous"
referrerpolicy="no-referrer"
data-site-key="ifa_site_..."
></script>The snippet makes no request and records nothing until your page grants consent. Call this from your consent banner once the visitor agrees, before or after the snippet loads:
window.ironfangAnalytics = window.ironfangAnalytics || [];
ironfangAnalytics.push(['setConsent', { replay: true }]);When the visitor withdraws it, recording stops and anything not yet sent is discarded in the browser:
ironfangAnalytics.push(['setConsent', { replay: false }]);A visit across several pages in the same tab continues one recording. If your site has a Content Security Policy, allow https://analytics.ironfang.uk in script-src and connect-src.
What is recorded
The page as it was displayed, and the scrolling, pointer movement, clicks and page changes on it. Masking happens in the visitor's browser, before anything is sent:
- Every form field's value is replaced with placeholders, whatever the site settings say.
- Password, payment card and sign-in fields are blocked: they appear as empty boxes of the same size.
- With Mask all text on (the default), page text is masked too; list selectors whose text is safe to show.
- Regions matching your block selectors, or carrying the
rr-blockclass, are never recorded. - Recorded URLs keep no query values and no fragments except the parameters you allow, such as
utm_source.
Beside each recording Ironfang keeps the visitor's IP address and whether Cloudflare reported it, the full user agent, window and screen size, pixel ratio, language, time zone, country and the page they came from without its query. All of it is deleted with the recording. Your privacy notice should say that you record sessions and keep these details.
Sites and origins
A site is one website: the origins its recorder may send from, a public collection key and what it captures. A public origin must be verified before it records: publish _ironfang-analytics.<host> as a TXT record with the value the portal shows. Loopback origins such as http://localhost:3000 need no record, for development.
The public key is safe to publish: it can only ask to record for its own site. Rotating it keeps the old key working for 24 hours so cached pages keep recording.
Recordings
Search recordings across every site by date, state, country, device class, browser, operating system, IP address or network in CIDR notation, and entry path. A recording opens on its replay and the visitor details kept with it.
A recording is one browser tab on one site. It ends when the visitor leaves, after 30 minutes with nothing received, or at 60 minutes or 100 MiB, whichever comes first. Deleting a recording removes its replay and every detail kept with it at once.
API keys and scopes
Platform API keys are minted in the portal and start with if_live_. Send one as a bearer token; it acts only in the organisation it was minted for.
Authorization: Bearer if_live_...analytics:sites:readRead sites, their origins, keys, settings history and installation stateanalytics:sites:writeCreate and change sites, add and verify origins, rotate the public keyanalytics:sessions:readSearch and read recordings, with their visitor details, and fetch their playback batchesanalytics:sessions:deleteDelete a recordinganalytics:*All Ironfang Analytics scopes
Errors
Every error is a JSON object with a stable code, a message for people and the request id to quote to support.
{
"error": {
"code": "not_found",
"message": "no such object in this organisation",
"docs": "https://ironfang.uk/analytics/docs#errors"
},
"request_id": "01a0c375-7bae-7f02-a3d4-91e6b8c25f70"
}| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_query, invalid_json | A query parameter or body is unknown, repeated or malformed. |
| 401 | unauthorized, invalid_api_key | No credential, or one that does not resolve. |
| 403 | forbidden, insufficient_scope | The key lacks the scope, or names another organisation. |
| 404 | not_found | No such object in this organisation, including an expired recording. |
| 409 | conflict, version_conflict | It already exists, or the site changed since you read it. |
| 422 | invalid_request, limit_reached | A field is invalid, or a limit on sites or origins would be exceeded. |
Limits and retention
- Recordings are kept 28 days from when they start, then deleted with every detail kept with them.
- The Free plan includes 1,000 recordings a month and 2 GiB of stored recordings; paid plans are on the pricing section.
- When a month's recordings are used up, new visits are not recorded until the next month. Pages keep working and recordings already made are unaffected.
- Up to 100 sites per organisation. A recording ends at 60 minutes or 100 MiB compressed.
- Lists page with
cursorandlimit, up to 100 per page.
API reference
Base URL https://api.ironfang.uk/analytics. The OpenAPI 3.1 document at https://api.ironfang.uk/analytics/openapi.yaml carries every schema and error, with stable operation ids for generated clients.
| Endpoint | Scope | Does |
|---|---|---|
GET /v1/capabilities | analytics:sites:read | What this deployment can do and the limits it applies. |
GET /v1/sites | analytics:sites:read | List sites with their setup state. |
POST /v1/sites | analytics:sites:write | Create a site with its origins. |
GET /v1/sites/{siteId} | analytics:sites:read | Get a site with its configuration, origins and keys. |
PATCH /v1/sites/{siteId} | analytics:sites:write | Change a site against the version you read. |
GET /v1/sites/{siteId}/config-versions | analytics:sites:read | List the site's settings history. |
POST /v1/sites/{siteId}/origins | analytics:sites:write | Add an origin. |
DELETE /v1/sites/{siteId}/origins/{originId} | analytics:sites:write | Remove an origin. |
POST /v1/sites/{siteId}/origins/{originId}/verify | analytics:sites:write | Check the origin's DNS record. |
POST /v1/sites/{siteId}/keys/rotate | analytics:sites:write | Rotate the public key. |
GET /v1/sites/{siteId}/installation | analytics:sites:read | What the site still needs, and its install snippet. |
GET /v1/recordings | analytics:sessions:read | Search recordings across sites. |
GET /v1/recordings/{recordingId} | analytics:sessions:read | Get a recording with its visitor details and epochs. |
GET /v1/recordings/{recordingId}/playback | analytics:sessions:read | List the batches that can be played, in order. |
GET /v1/recordings/{recordingId}/chunks/{epoch}/{sequence} | analytics:sessions:read | One batch of rrweb events. |
DELETE /v1/recordings/{recordingId} | analytics:sessions:delete | Delete a recording and every detail kept with it. |
Machine interfaces
| Interface | Details |
|---|---|
| Product page | https://ironfang.uk/analytics |
| Documentation | https://ironfang.uk/analytics/docs |
| API base URL | https://api.ironfang.uk/analytics |
| OpenAPI contract | https://api.ironfang.uk/analytics/openapi.yaml. The same contract is served as JSON at https://api.ironfang.uk/analytics/openapi.json. |
| Authentication | Platform API key as a bearer token |
| Errors | https://ironfang.uk/analytics/docs#errors. A JSON body with a stable code, a message, this link and the request id. |
| MCP | Not available. Not yet available over MCP. Sites, recordings, playback and deletion are in the portal and the REST API. MCP server reference; every tool and schema without a token at /.well-known/ironfang-mcp.json |
| Discovery | /apis.json, /.well-known/api-catalog and /llms.txt |
