How we measure playtime
What counts as play, the exact idle, hidden-tab, ad-break and 4-hour limits, the midnight rule, a worked example, and why your numbers can differ.
Playtime is the most misread number in the console. This page gives the exact rules the portal uses, with the limits as they are today, so you can predict what the console will show for a given player and fix a game whose number looks wrong. The definitions of every other figure are in the analytics and metrics reference; the calls your game must make are in get accurate analytics.
What counts as play#
A play starts when your game calls SDK.game.gameplayStart(). The portal never guesses a play from input, so a game that never calls it has no plays and no playtime.
Playtime is the time the player spends in your game from that first call until they leave, counting only the moments when all of these are true:
- the tab is visible (a window that is visible but not focused, such as one on a second monitor, still counts);
- no ad is on screen;
- the player has given input within the last 30 minutes (see below);
- the session is still inside its 4-hour limit.
Everything else in the game counts: pause menus, results screens, shops and level select, because the player is still there. Your gameplayStop() does not stop the clock; it is a hint for the portal, not a measurement.
Only the first gameplayStart() after the game frame loaded opens a play. Calls for a new round in the same page are the same play. Reloading the game, or opening it again, starts a new play.
The limits, with numbers#
| Rule | Exact value | What happens |
|---|---|---|
| Checkpoint | One every 60 seconds while time is counted | A closed tab, a crash or a lost connection keeps everything up to the last checkpoint. A play sends at most 240 checkpoints, which is the 4-hour limit. |
| Hidden tab | At once | The clock stops when the tab is hidden, the page is put in the back/forward cache or the app is switched on a phone. It continues the same play when the page is visible again. |
| Ad break | From the ad request to the end of the break | The clock stops when the portal asks a provider for an ad and runs again when the break ends. A break that never starts is given up after 8 seconds, and one that starts and never reports its end is closed after 3 minutes at the latest. After an ad the inactivity count starts again, so an ad never makes a player idle. |
| Idle | 30 minutes with no input, tab visible | The clock stops and the time is dated at the player's last input, so none of the idle half hour is credited. The next input continues the same play and does not count a new one. |
| Silent gap | At most 5 minutes after a checkpoint or a resume with nothing after it | If checkpoints are lost (a dropped connection, a sleeping machine), only 5 minutes of the silence are credited. |
| First stretch | At most 30 minutes from a gameplayStart() to the next event of the same page |
A start that is followed by a stop, never by a checkpoint, credits at most half an hour. Normally a checkpoint arrives within a minute. |
| Long session | 4 hours per play | Time beyond it is not counted, whatever the player does. A tab left open on a running game cannot add hours. |
| Two tabs | Shared time counted once | A player with two windows open on the same game is credited for the time at least one of them was playing, not twice. |
| Conversion | 60 seconds | A play with at least 60 seconds of playtime counts as converted. |
What counts as input. On the portal page: a mouse or pen press, a key press or a touch. Inside your game, the SDK reports activity to the portal at most once every 15 seconds: presses, key presses, touches, mouse movement, the wheel and gamepad buttons or sticks. The ping carries no key, position or pad data.
Inactivity is judged only for games on SDK 1.8.1 or later. A game on an older SDK sends no activity, so the portal cannot see its input and only the 4-hour limit applies to it. Update the SDK to get the idle rule; for the effect on your numbers see "Why my number differs" below.
The midnight rule#
Every day is a UTC day, midnight to midnight. A play belongs entirely to the day on which its gameplayStart() happened: all of its playtime and its play count are on that day, even when the player is still playing after midnight, and nothing is added to the next day. The nightly figures settle once the hourly job after midnight has run; the portal reads events up to four hours past midnight so a session that began just before it is seen in full.
Consent, kids, bots and staff#
- Consent. The play count is anonymous and counts every player. Playtime needs the player's analytics cookie category: the checkpoints, stops and resumes are not sent without it. So playtime, average playtime, conversion and playtime per player describe the players who allowed analytics, on both sides of the division.
- Kids. Kids mode and kids games send no analytics events. Their plays are stored as minimal anonymous rows with no country or device, and they carry no playtime at all.
- Bots. Requests from crawlers, link previews, headless browsers and scripted clients (recognised by their user agent, and any request with a missing or very short one) are dropped and never counted. Events that look machine-made (very regular timing, floods from one address) are scored; those judged invalid are not stored and only appear in a daily quality count.
- Staff. Plays and views of signed-in portal staff and internal QA are not stored.
- Per-address limits. Per IP address and game and day at most 60 gameplay starts are accepted. A school or office behind one address can reach it.
A worked timeline#
A player starts a game at 22:50 UTC. The game is on SDK 1.8.1.
| Time (UTC) | What happens | Counted |
|---|---|---|
| 22:50:00 | gameplayStart(). One play is counted on this day. |
Clock starts |
| 22:55:00 | The player switches to another tab. | 5:00 so far |
| 22:59:00 | Back in the tab. | Clock continues |
| 23:10:00 | The game requests a mid-game ad. | 11:00 more, 16:00 so far |
| 23:10:30 | The ad ends. | Ad time (0:30) not counted |
| 23:30:00 | The player's last input, then they walk away. | 19:30 more, 35:30 so far |
| 00:00:00 | 30 minutes without input: the clock stops, dated 23:30:00. | The idle half hour is not counted |
| 00:20:00 | The player comes back and presses a key: same play, clock continues. | Not counted before this |
| 00:35:00 | The player closes the tab. | 15:00 more, 50:30 in total |
Result: 1 play, 3,030 seconds of playtime, one converted play (at least 60 seconds), all on the earlier UTC day, although 15 minutes of it happened after midnight. The 4 minutes hidden, the 30 seconds of ad and the 50 minutes away are not in it. Had the game been on an older SDK, the idle rule could not apply: the 50 minutes without input would be counted, up to the 4-hour limit.
Why my number differs from my own analytics#
| Cause | What you will see |
|---|---|
| Only players who allowed analytics have playtime. | Your own analytics may count every visitor. The console's average is the average of the consenting players. Plays (anonymous) are counted for everyone. |
| Other tools count time on the page, the portal counts time in the game. | Hidden-tab time, ad time and idle time are not in the portal's figure; a tool that measures page open time reports more. |
| A different session rule. | A tool that ends a session after 30 minutes of inactivity starts a new session on the next input. The portal keeps the same play and has no 30-minute-then-new-session rule; it has a 4-hour limit on one play instead. A play is also not a page view: a reload is a new play, a new round is not. |
| UTC days. | Your tool may cut days in your own time zone. A play started at 23:50 UTC is entirely on that day. |
| Update delay. | Counts and playtime are recomputed hourly, at five past the hour; today's figure lags. |
Your game's gameplayStart() moment. |
Calling it on the menu starts the clock too early and inflates playtime and plays; calling it late leaves the first minutes out. |
| Old SDK. | No activity is reported, so the 30-minute idle rule cannot stop the clock; a player who left the tab open and visible is credited up to 4 hours. |
| Bots, staff, kids traffic. | Not counted in the portal, but possibly counted by a tool you run yourself. |
| Lost events. | A browser extension or network that blocks the portal's own event requests loses those events; checkpoints that could not be sent are lost, and a silent stretch is credited for at most 5 minutes. |
| Two tabs. | Shared time is counted once. |
SDK calls that measure play right#
- Call
await SDK.init()first. Nothing is reported before it resolves. - Call
loadingStart()when the assets the player waits for begin loading, andloadingStop()when the first frame the player could act on is ready (this is load time, not playtime). - Call
gameplayStart()the moment the player takes control of the first level: after the menu and after any "tap to start". Not at page load. - Call
gameplayStop()at pauses, game over and before ads, for the pause signal and Full Launch. It does not change playtime. - Run the latest SDK (1.8.1 or later) so the portal can see input in your game and apply the idle rule.
- Request ads with
SDK.ad.requestAd()at natural breaks, so the clock excludes the ad.
const SDK = window.ZokoGames.SDK;
await SDK.init();
await SDK.game.loadingStart();
// ... load assets ...
await SDK.game.loadingStop();
showMenu(); // the menu is not play
startLevel(); // the player has control
await SDK.game.gameplayStart(); // one play; the playtime clock starts
// pause, results, game over:
await SDK.game.gameplayStop();Check each call in the Preview tool before you submit; the steps are in get accurate analytics.