Skip to content

SDK Documentation 📃

Intention of events

Thanks to our developer-friendly SDK, you can easily oversee the most important metrics of your game simply by firing a couple of SDK events during various moments in the game. This information includes, but is not limited to:

  • Daily Playing Users: The amount of page visitors and the percentage of users who are able to play the game.
  • Engagement: Average time players spends in game. Also shows how much time is spent on loading or ads.
  • Earnings: Ad-related metrics such as total earnings, or the distribution of impression types.
  • Error Scanner: Details for all of errors of the past 24 hours, updated hourly.
  • Player Feedback: Details on player rating and comments.

Definition of events

  •  âŒ› gameLoadingFinished() : Pretty self-explanatory, we’d say. We need this to track the loading progress of your game and show your conversion to play.
  •  ðŸŽ® gameplayStart() : Fires whenever the actual gameplay is going on (e.g. at the start of a level or when the game is unpaused).
  •  â˜  gameplayStop() : Fires whenever the gameplay halts (e.g. when the game is paused, the level is completed or when the player is dead).
  •  ðŸŽž commercialBreak() : Fires with the natural stops in the game (e.g. between levels, restarting a level, or basically any scenario where the player is about to go back into the gameplay stage).
  •  ðŸŽ¬ rewardedBreak() : Fires with user prompt in exchange for an in-game reward (e.g. unlocking gold or bonus items, revival after death, or any scenario where you can convince the player to watch an ad).

Example order of events:

  • Startup:  âŒ› gameLoadingFinished()  >  ðŸŽ® gameplayStart() 
  • Player dies and restarts:  â˜  gameplayStop()  >  ðŸŽž commercialBreak()  >  ðŸŽ® gameplayStart() 
  • Player dies and revives:  â˜  gameplayStop()  >  ðŸŽ¬ rewardedBreak()  >  ðŸŽ® gameplayStart() 
  • Player goes to next level:  â˜  gameplayStop()  >  ðŸŽž commercialBreak()  >  ðŸŽ® gameplayStart() 
  • Player goes to next level with double rewards:  â˜  gameplayStop()  >  ðŸŽ¬ rewardedBreak()  >  ðŸŽ® gameplayStart() 
  • Player pauses / unpauses:  â˜  gameplayStop()  >  ðŸŽ® gameplayStart() 

Note: if an ad is fired when gameplay is not interrupted (for example if the player watches an ad to unlock a character skin), it’s not necessary to fire a  â˜  gameplayStop()  or  ðŸŽ® gameplayStart()  event.

Testing of events

Our Inspector is designed to help test your game and the implementation of the SDK events easily. Simply drag and drop your game folder that contains an index.html file and you’re set.

The tool will run the game as if it’s live on the platform, so you can test the game’s behavior on any device or browser. The tool also outputs the event log, so you can check if the SDK events are firing correctly.

Versioning with CLI

The Poki for Developers command line utility allows you to upload game builds directly from your terminal or CI-pipeline. Please check our Github repository for more information on installation.

Full examples

If you’d like to see a full example of the SDK implementation for each game engine, check these links out:

HTML5  |  Unity  |  GameMaker  |  Phaser 3