free_breakfast Before you start: ByteBrew only supports Android platform for Godot.
1: Import ByteBrew Godot Package to your project
Extract the contents of the android folder from the zip:
A. ByteBrew.gdap
B. bytebrew_godot.release.aar
Place the two files in your project file path res://android/plugins if you dont have this path create it in the root of your project file.
2: Enable ByteBrew in Project
Go to Project -> Export and select your android export settings. Scroll down to the Plugins section and enable ByteBrew by checking it.
3: Go to your ByteBrew Dashboard
Go to your game settings on the ByteBrew dashboard and find your game keys listed on the dashboard.
4: Initialize ByteBrew
You must initialize ByteBrew using the code below at the first scene of your game if you want to start capturing events and sessions.
priority_high Important: Place your game object on the first scene of your game. ByteBrew SDK does not support offline event caching.
Inside Godot, input the game keys from your game into parameters of the ByteBrew initialization.
var ByteBrew
func _ready():
if Engine.has_singleton("ByteBrew"):
ByteBrew = Engine.get_singleton("ByteBrew")
//You must make sure add the last two parametes the GameMaker Version and your current version of your project so you can get deep cohort analytics.
ByteBrew.InitializeByteBrew("GAME ID", "GAME KEY", Engine.get_version_info(), "YOUR GAME VERSION HERE ex(0.0.1)")
5: Exporting Android Requirements
ByteBrew requires the following implementation for android:
A. Play Services Ads Identifier
We have already added requirements in the settings to add this implementation.
Add a Custom Small Icon and Large Icon for push notifications.
free_breakfast The small icon automatically defaults to your app icon. We recommend that you add a small icon because your app icon may not appear correctly. If the large icon default is none, it will not show.
Make sure to add these icons to your res android folder. Keep note of the name of the icon, so you can set them in the dashboard when creating a notification.
To validate and track the in-app purchase utilize the specific platform method.
Make sure the receipts have correct JSON string formatting.
//JSON Format ex. string json = "{\"firstname\":\"john\", \"lastname\":\"doe\",\"age\":30}";
//Retrieve the Android receipt and Signature from the purchase event that occurs. We will validate it server side so you can view valid purchases in you dashboard.
var googleReciept = "..."
var googleSignature = "..."
ByteBrew.TrackGoogleInAppPurchaseEvent("Google Play Store", "USD", float(amount), "currencyPack01", "Currencies", googleReciept, googleSignature)
To add more detail to an event you can add a secondary parameter, that can be a float or string value
//string example
ByteBrew.NewCustomEventWithStringValue("weapon_equip", "megablaster")
//float example
ByteBrew.NewCustomEventWithFloatValue("lives_earned", float(5))
To add additional custom parameters to an event you can format a string with key=value; pairs. Checkout the example below.
//Key Value format "key=value;"
//It can take multiple pairs as well, "key1=pair1;key2=pair2;key3=pair3;"
ByteBrew.NewCustomEventWithStringValue("level_started", "weapon=megablaster;powerup=extralife;")
You can track a progression event using the parameters list below.
Progression events get tracked based on the following parameters:
1: ProgressionType
The type of event context that occured. Must use one of the following: Started, Completed or Failed
2: Environment
Area of the game or World it occurs (Ex. Tutorial, Arena, Level)
3: Stage
The stage of the environment (Ex. kings_arena, jungleLevel, level_02)
4: Value
This can be a string or float value attached to the event
//Example Progression event where the user started a tutorial in arena 0 or first arena
ByteBrew.NewProgressionEvent("Started", "Tutorial", "arena0")
//Example progression event where the user has completed the kings arena and could be rewarded with 3 crowns
ByteBrew.NewProgressionEventWithFloatScore("Completed", "Arena", "kings_arena", float(3))
Track ad events that occur to get more detailed breakdowns in your monetization, especially when doing LTV and ROAS calculations.
// Record the Placement Type, Location of the placement, ad unit ID, and Network (Recommended)
ByteBrew.TrackAdEventWithAllOptions("Interstitial", "EndOfLevel", "3253k3302-3r3j4i343-3nij343-405403", "AdMob")
//Some ad event paramters can be ommited like so
ByteBrew.TrackAdEvent("Interstitial", "EndOfLevel")
ByteBrew.TrackAdEventWithAdID("Interstitial", "EndOfLevel", "3253k3302-3r3j4i343-3nij343-405403")
Remote configs help you edit your apps settings and configuration without needed to update your app on the store.
AB Testing is to cross track changes across a variety of users when they onboard to your game, we distribute AB Test variables from remote configs. So make sure to check for the AB test you are tracking
1: Loading the Remote Configs
When using Remote Config you must first call for the config to get updated. You can call this whenever you want to update the configs.
ByteBrew automatically calls LoadRemoteConfig on initialization but you can call it again when needed.
//Call the loader to update configs
ByteBrew.LoadRemoteConfigs()
//Check if the remote configs are ready and set
ByteBrew.HasRemoteConfigsBeenSet()
You can grab AB Test keys and values from this method as well, if the user is part of the control group it wont return anything but the default parameter value set.
//Call to get the key specific value and if the key doesn't exist it will return the default variable specified, like if the AB test user is in the control group
var configValue = ByteBrew.RetrieveRemoteConfigValue("KEY", "DEFAULT VALUE IF NOT AVAILABLE")
To view your game's remote configs visit the remote config page on the ByteBrew dashboard.
Call the ByteBrew StopTracking method to stop and disable tracking for a user. Alternatively, if you have your own consent prompt, you can delay the intialization of the ByteBrew SDK until your user has consented to be tracked.