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

  •  đŸĒĢ gameLoadingStarted()  &  đŸ”‹ 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, the player is dead, or an advertisement is played).
  •  đŸŽŦ 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:  đŸĒĢ gameLoadingStarted()  >  đŸ”‹ 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() 

Testing of events

Our QA Tool 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