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. To stop recording a visitor, call the opt-out function from your consent banner or a link.
Recordings appear under Recordings in the portal within seconds of a visit.
Install, opt-out 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.com/sdk/0.3.1/loader.js"
integrity="sha384-..."
crossorigin="anonymous"
referrerpolicy="no-referrer"
data-site-key="ifa_site_..."
></script>The snippet records from the first page load. To opt a visitor out, call this from your consent banner or a link, before or after the snippet loads. Recording stops, anything not yet sent is discarded in the browser, and the browser remembers the choice, so later pages do not record either:
window.ironfangAnalytics = window.ironfangAnalytics || [];
ironfangAnalytics.push(['setConsent', { replay: false }]);If the visitor changes their mind, setConsent({ replay: true }) starts recording again.
Where the law requires consent before recording, as it usually does for visitors in the UK and the EU, turn on Ask for consent first in the site's Recording tab. The snippet the Installation tab then gives you carries data-consent="required": it makes no request and records nothing until your page calls setConsent({ replay: true }) once the visitor agrees. Deciding whether your visitors need to be asked is yours to do.
A visit across several pages in the same tab continues one recording. Once a recording starts, the browser also keeps a random visitor id in local storage and sends it with each new recording, so a second tab or a return visit can be found beside the first. It is made from nothing about the visitor, it is not a cookie, and opting out deletes it.
If your site has a Content Security Policy, allow https://analytics.ironfang.com 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:
- Anything that looks like a payment card number is masked wherever it appears: in page text, in a field or in an attribute. This is always on.
- Card number, CVV, password and one-time-code fields are blocked: they appear as empty boxes of the same size. This is always on too.
- With Mask form fields on, every field's value is replaced with placeholders, and so is text typed into an editable region (
contenteditable). It is off for a new site. - With Mask all text on, page text is masked too; list selectors whose text is safe to show. It is off for a new site.
- Regions matching your always-mask selectors have their text and fields masked either way.
- Regions matching your block selectors, or carrying the
rr-blockclass, are never recorded. - Recorded URLs never keep a fragment. They keep only the query parameters you list, such as
utm_source, or, with Record all query parameters on, every parameter except the ones you list to remove, such astoken.
To keep your own visits out of your recordings, list your home or office addresses under Excluded visitors in the site's capture settings: single addresses or ranges such as 203.0.113.0/24, or a network's /64 for IPv6. A visit from one is not recorded at all, and the settings page can add the address of the device you are using.
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, the page they came from without its query and the browser's visitor id. All of it is deleted with the recording. Your privacy notice should say that you record sessions and keep these details, and that the browser keeps a visitor id.
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, entry path and visitor id. A recording opens on its replay and the visitor details kept with it, with the same browser's other recordings beneath.
A recording whose visitor is on the site now is Live, and opens live: you see the page a second or two behind them. While you watch, their browser sends what it records every second instead of every ten seconds. Nothing on their page changes, and nothing tells them anyone is watching. A recording that is still open but has not been heard from for 90 seconds is Inactive: the visitor has most likely left.
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.com/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.com/analytics. The OpenAPI 3.1 document at https://api.ironfang.com/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.com/analytics |
| Documentation | https://ironfang.com/analytics/docs |
| API base URL | https://api.ironfang.com/analytics |
| OpenAPI contract | https://api.ironfang.com/analytics/openapi.yaml. The same contract is served as JSON at https://api.ironfang.com/analytics/openapi.json. |
| Authentication | Platform API key as a bearer token |
| Errors | https://ironfang.com/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 |

