How the Data Is Collected
The Statistics API only reads data. It never creates it. The events come from the Doc Gen applications your company uses, and they are stored only while your company has a Statistics licence.
Where events come from
Doc Gen applications send their events as they happen. Metatool sends its usage as a count instead: a count of 5 shows up as 5 events in the same hour. Your own scripts do not send events, they only read them.
From event to API
- A Doc Gen application records an event, for example that a form was created, and sends it to Statistics together with your company and the time it happened.
- The event waits in a queue. Statistics then checks that your company has a valid Statistics licence and stores the event with your company’s other events.
- When you call the API, it counts the stored events per hour and per combination of fields and returns the counts.
Your company is the only one that can read its events.
Licence
Events are stored only while your company has a valid Statistics licence. An event that arrives while the licence is missing or not valid is dropped and cannot be added later.
Statistics remembers the licence state for about five minutes. A change to your licence can therefore take that long to affect which events are stored.
A company that has never had events stored gets 404 from the API, see API Endpoints.
Timing
Events are stored through a queue, so a new event can take a little while to show up in the API. Do not build anything that depends on an event being readable the moment it happens.
The date and hour of a row come from the time the application recorded the event, not the time it was stored. The count for an hour can therefore still grow for a short while after the hour has ended. The smallest step you can see is one hour.
What is not included
- Rows for single events. You get counts, not the individual events.
- Data from other companies.
- Events from a time when your company had no valid Statistics licence.
Customers do not send events themselves. The endpoints that receive events are for Doc Gen components and Metatool only.
Reading the fields
| Field | What it tells you |
|---|---|
| event | What happened |
| system | Which Doc Gen application recorded it |
| template | Which template or form it was about |
| source | Where it came from |
| distribution | How the result was delivered |
| environment | The environment name the application reported |
| area | The functional area |
| eventDetail | Extra context, when the application sent any |
See Data Models for the exact field types and the values you will see.