-
Notifications
You must be signed in to change notification settings - Fork 0
Standard Events Format
This document provides a standard way to record events and parameters in a level based game. You are strongly advised to use standard events and corresponding syntax to record player behavior in your game.
The standard means of recording an event is by creating a dictionary and then calling the appropriate SendEvent function. The following is a C# example for sending an event with embedded custom data.
//Create a Dictionary to hold your custom data
Dictionary<string, object> customData = new Dictionary<string, object> ();
customData.Add ("custom_string_data", "string_data");
customData.Add ("custom_int_data", 10101);
//Event Dictionary containing three standard Gravitum Paramters and the embedded customData
Dictionary<string, object> eventData = new Dictionary<string, object> ();
eventData.Add("ParameterLevel”,3);
eventData.Add("ParameterSubLevel”,”Roses”);
eventData.Add("ParameterScore”,10456);
eventData.Add("CustomData",customData); //Add Custom data Dict
//Record the event
Gravitum.Analytics.SendEvent ("LevelFail", eventData);The rest of this document lists pre-defined documents in Gravitum for recording most player gameplay events.
a) TutorialStarted : When the intro tutorial starts (if any)
C# Example:
{
//Create a Dictionary to hold your custom data
Dictionary<string, object> customData = new Dictionary<string, object> ();
customData.Add ("custom_string_data", "string_data");
customData.Add ("custom_int_data", 10101);
//This event has no standard Gravitum Params. Only custom data if you choose to send any.
Dictionary<string, object> eventData = new Dictionary<string, object> ();
eventData.Add("CustomData",customData); //Add Custom data Dict
//Record the event
Gravitum.Analytics.SendEvent ("TutorialStarted", eventData);
} b) TutorialSkipped : When the intro tutorial skipped (if any)
{
//Create a Dictionary to hold your custom data
Dictionary<string, object> customData = new Dictionary<string, object> ();
customData.Add ("custom_string_data", "string_data");
customData.Add ("custom_int_data", 10101);
//This event has no standard Gravitum Params. Only custom data if you choose to send any.
Dictionary<string, object> eventData = new Dictionary<string, object> ();
eventData.Add("CustomData",customData); //Add Custom data Dict
//Record the event
Gravitum.Analytics.SendEvent ("TutorialSkipped", eventData);
} c) TutorialComplete : When the intro tutorial is finished
{
//Create a Dictionary to hold your custom data
Dictionary<string, object> customData = new Dictionary<string, object> ();
customData.Add ("custom_string_data", "string_data");
customData.Add ("custom_int_data", 10101);
//This event has no standard Gravitum Params. Only custom data if you choose to send any.
Dictionary<string, object> eventData = new Dictionary<string, object> ();
eventData.Add("CustomData",customData); //Add Custom data Dict
//Record the event
Gravitum.Analytics.SendEvent ("TutorialComplete", eventData);
} a) Navigation : When the player navigates to a particular screen in the game.
{
//Create a Dictionary to hold your custom data
Dictionary<string, object> customData = new Dictionary<string, object> ();
customData.Add ("custom_string_data", "string_data");
customData.Add ("custom_int_data", 10101);
//Event Data with the standard ParameterScreenName as the the event
Dictionary<string, object> eventData = new Dictionary<string, object> ();
eventData.Add("ParameterNavigation", "Screen 1");
eventData.Add("CustomData",customData); //Add Custom data Dict
//Record the event
Gravitum.Analytics.SendEvent ("Navigation", eventData);
}a) LevelStart: When a player starts a level.
{
//Create a Dictionary to hold your custom data
Dictionary<string, object> customData = new Dictionary<string, object> ();
customData.Add ("custom_string_data", "string_data");
customData.Add ("custom_int_data", 10101);
//Event Data with different standard events
Dictionary<string, object> eventData = new Dictionary<string, object> ();
eventData.Add("ParameterLevel", 2);
eventData.Add("ParameterSubLevel", 4);
eventData.Add("ParameterScore", 110);
eventData.Add("CustomData",customData); //Add Custom data Dict
//Record the event
Gravitum.Analytics.SendEvent ("LevelStart", eventData);
}b) LevelFinish: When a player finishes a level.
{
//Create a Dictionary to hold your custom data
Dictionary<string, object> customData = new Dictionary<string, object> ();
customData.Add ("custom_string_data", "string_data");
customData.Add ("custom_int_data", 10101);
//Event Data with different standard events
Dictionary<string, object> eventData = new Dictionary<string, object> ();
eventData.Add( "ParameterLevel", 3);
eventData.Add("ParameterSubLevel", 2);
eventData.Add("ParameterScore", 230);
eventData.Add("CustomData",customData); //Add Custom data Dict
//Record the event
Gravitum.Analytics.SendEvent ("LevelFinish", eventData);
}c) LevelFailed: When a player fails to finish a level.
{
//Create a Dictionary to hold your custom data
Dictionary<string, object> customData = new Dictionary<string, object> ();
customData.Add ("custom_string_data", "string_data");
customData.Add ("custom_int_data", 10101);
//Event Data with different standard events
Dictionary<string, object> eventData = new Dictionary<string, object> ();
eventData.Add("ParameterLevel", 2);
eventData.Add("ParameterSubLevel", 4);
eventData.Add("ParameterScore", 110);
eventData.Add("CustomData",customData); //Add Custom data Dict
//Record the event
Gravitum.Analytics.SendEvent ("LevelFailed", eventData);
}d) Acheivement: When an achievement is unlocked while playing the game.
{
//Create a Dictionary to hold your custom data
Dictionary<string, object> customData = new Dictionary<string, object> ();
customData.Add ("custom_string_data", "string_data");
customData.Add ("custom_int_data", 10101);
//Event Data with different standard events
Dictionary<string, object> eventData = new Dictionary<string, object> ();
eventData.Add("ParameterAchievmentID", "Special Axe");
eventData.Add("CustomData",customData); //Add Custom data Dict
//Record the event
Gravitum.Analytics.SendEvent ("Achievement", eventData);
}a) SpentVirtualCurrency : When Virtual Currency is spent in the game
{
//Create a Dictionary to hold your custom data
Dictionary<string, object> customData = new Dictionary<string, object> ();
customData.Add ("custom_string_data", "string_data");
customData.Add ("custom_int_data", 10101);
//Event Data with different standard events
Dictionary<string, object> eventData = new Dictionary<string, object> ();
eventData.Add("ParameterValue", 200);
eventData.Add("ParameterCurrency", "Gold Coins");
eventData.Add("CustomData",customData); //Add Custom data Dict
//Record the event
Gravitum.Analytics.SendEvent ("SpentVirtualCurrency", eventData);
}b) EarnedVirtualCurrency : When a virtual currency is earned
{
//Create a Dictionary to hold your custom data
Dictionary<string, object> customData = new Dictionary<string, object> ();
customData.Add ("custom_string_data", "string_data");
customData.Add ("custom_int_data", 10101);
//Event Data with different standard events
Dictionary<string, object> eventData = new Dictionary<string, object> ();
eventData.Add( "ParameterCurrency", "Gems");
eventData.Add("ParameterValue", 20);
eventData.Add("CustomData",customData); //Add Custom data Dict
//Record the event
Gravitum.Analytics.SendEvent ("EarnedVirtualCurrency", eventData);
}a) StoreOpened : Store is opened
//Create a Dictionary to hold your custom data
Dictionary<string, object> customData = new Dictionary<string, object> ();
customData.Add ("custom_string_data", "string_data");
customData.Add ("custom_int_data", 10101);
//This event has no standard Gravitum Params. Only custom data if you choose to send any.
Dictionary<string, object> eventData = new Dictionary<string, object> ();
eventData.Add("CustomData",customData); //Add Custom data Dict
//Record the event
Gravitum.Analytics.SendEvent ("StoreOpened" , eventData);b) StoreItemSelect : When the user selects an item in the Store
{
//Create a Dictionary to hold your custom data
Dictionary<string, object> customData = new Dictionary<string, object> ();
customData.Add ("custom_string_data", "string_data");
customData.Add ("custom_int_data", 10101);
//This event has 1 standard Gravitum Params
Dictionary<string, object> eventData = new Dictionary<string, object> ();
eventData.Add("ParameterItemName", "10k Pack");
eventData.Add("CustomData",customData); //Add Custom data Dict
//Record the event
Gravitum.Analytics.SendEvent ("StoreItemSelect" , eventData);
}a) SocialLogin: When the player logs in
//Create a Dictionary to hold your custom data
Dictionary<string, object> customData = new Dictionary<string, object> ();
customData.Add ("custom_string_data", "string_data");
customData.Add ("custom_int_data", 10101);
//This event has 1 standard Gravitum Params
Dictionary<string, object> eventData = new Dictionary<string, object> ();
eventData.Add("ParameterSocialNetwork", "Facebook/Twitter/etc");
eventData.Add("CustomData",customData); //Add Custom data Dict
//Record the event
Gravitum.Analytics.SendEvent ("SocialLogin" , eventData);
b) SocialShare: When the player shares game play info
{
//Create a Dictionary to hold your custom data
Dictionary<string, object> customData = new Dictionary<string, object> ();
customData.Add ("custom_string_data", "string_data");
customData.Add ("custom_int_data", 10101);
//This event has 1 standard Gravitum Params
Dictionary<string, object> eventData = new Dictionary<string, object> ();
eventData.Add("ParameterSocialNetwork", "Facebook/Twitter/etc");
eventData.Add("CustomData",customData); //Add Custom data Dict
//Record the event
Gravitum.Analytics.SendEvent ("SocialShare" , eventData);
}c) SocialLogout : When the player logs out
//Create a Dictionary to hold your custom data
Dictionary<string, object> customData = new Dictionary<string, object> ();
customData.Add ("custom_string_data", "string_data");
customData.Add ("custom_int_data", 10101);
//This event has 1 standard Gravitum Params
Dictionary<string, object> eventData = new Dictionary<string, object> ();
eventData.Add("ParameterSocialNetwork", "Facebook/Twitter/etc");
eventData.Add("CustomData",customData); //Add Custom data Dict
//Record the event
Gravitum.Analytics.SendEvent ("SocialLogout", eventData);