It's very important to understand what's going on in your games and how players actually play your game. Here is a small writeup of how you can use Google Analytics event tracking with your Bitsy game. Since Bitsy is a very limited game engine this solution is hacky and maintainability is limited - but it works :D.
- Add a Google Analytics snippet to your exported game HTML file, refer to this link.
Note: The snippet should be placed near the top of the head section. Don't forget to enter your personal tracking ID of your analytics property.
- Add the following hack (by Sean S LeBlanc) to your exported game HTML file. Using this hack you can execute arbitrary JavaScript code from dialogs in Bitsy.
You can now fire Google Analytics events from dialogs in Bitsy with the following syntax:
API:
(js "ga('send', 'event', '<category>', '<action>', '<label>', <value>)")
// Event category and action are required, event label and value are optional. //
Examples:
(js "ga('send', 'event', 'found item', 'pick-axe')")
(js "ga('send', 'event', 'game', 'completed', 'found treasure')")
Possible usage:
- Progress (How far do players play the game?): Put an invisible item over an exit to track screen by screen / level to level progress of players.
- Player choices (What do players do?): Track different events based on branching dialogs.
- Items (Can players find certain items?): Track if player has found a certain item in the game.
- etc.