Gameplay measurement
One Game a Day measures whether its advertising leads people to play, not just to open a page. Only the game knows when real play starts — a title screen looks exactly like a game to the page around it — so a game can carry a small script, the measurement bridge, and call it at a few moments of its own lifecycle.
It is optional. A game without it works exactly the same; its plays are simply not reported as game starts.
What the bridge is
A single inline script, the same in every game, placed right after <meta charset>. The platform's tooling inserts it; do not write or edit it by hand. It defines window.OGAD with five calls:
| Call | When your game calls it |
|---|---|
OGAD.ready() | The title screen or main menu is shown and nobody is playing. Also ends a run in progress. |
OGAD.start() | The player is actually playing: the playable state is on screen, reached by their own choice (Play, Continue, a level, Play again). Not at load, not on the title, not on menus or story cards before control. |
OGAD.start({ resumed: true }) | The same, when the player continues saved progress rather than starting fresh. |
OGAD.pause() / OGAD.resume() | Only if your game has its own pause. |
OGAD.end() | The run is over: game over, final victory, or the player quits it. Finishing a level and moving on is not an end. |
Call them as window.OGAD?.start() so the game still runs if the bridge is ever removed. The calls never throw. Repeating start() during a run is ignored, so level transitions need nothing; after end(), the next start() is a new run.
What it sends, and to whom
- Nothing at all until the page that frames the game asks for it with a one-time code, and then only to that page's exact address.
- Only the lifecycle moments above, with a run number. No score, input, save data, name or anything else from the game.
- No network request of its own, and it reads no storage. It does not change what the sandbox allows a game to do.
The page checks every message (sender frame, address, code, format) before believing it, and decides what counts as one play. When the visitor has refused measurement, the game is never asked. What the site then reports to Google, and on what terms, is described on the privacy page.
Adding it
For a game in the platform's own repository:
npm run games:bridge -- games/my-game # insert or update the bridge
npm run games:bridge -- --check games/my-game # what is there: the bridge, and which calls the game makes
Then place the calls in your code at the real transitions — the function that switches the game into play, game over or the title — on every path that leads there. The importer warns about a game without the bridge or without a start() call.
Test it in a real browser with the game in a frame on its own origin: open the game, wait on the title (nothing should be reported), start playing (exactly one start), play on (no second start), finish and play again (a new start).