In-app Events
Events help you to track all the user actions within your app. For example, sign up, purchase made, feedback given and so on. Events analytics and the associated data helps you understand your users.
Event types
Zoho Apptics provides two types of event analytics; Defined events and Custom events.
Defined events - These are the default events that are available for your use once you have integrated our SDK.
Custom events - These are the events that you want to capture using our SDK.
To be able to use either the defined or custom events, you need to:
- Make sure that you have integrated Apptics with your app, refer to the integration guide for detailed steps.
Logging custom events
Use AppticsEvents.addEvent() method to log the custom events, event groups, and custom properties. Event name and event group name are mandatory to be added and cannot be null or empty.
CopiedAppticsWindowsBase.Analytics.AnalyticsHelper.AddEvent("event_name", "group_name");
Make sure that event name and group name follow the below norms, else the event won't be logged within the SDK.
- should not be more than 100 characters.
- should start with an alphabet.
- should not contain any space or special characters apart from underscore (_).
- cannot start with 'ap_' or 'AP_'. These are reserved for the defined events.
An example of a valid event name : 'helloworld' , 'Hello_world' , 'helloWorld'
An example of an invalid event name : '_helloworld' , '1hello' , `Hello World` , 'ap_helloworld`
Custom events with properties
Event properties are any additional information that can be associated with the events you are capturing using our SDK. These properties are can be passed as a Dictionary<String,Object>.
Sample snippet to use properties as a Dictionary.
CopiedDictionary<string, object> keyValuePairs = new Dictionary<string, object>();
keyValuePairs.Add("param1string", "battery percentage 50");
keyValuePairs.Add("param2number", 12345);
keyValuePairs.Add("param3boolean", true);
AppticsWindowsBase.Analytics.AnalyticsHelper.AddEvent("bill", "mobile_number_change",keyValuePairs,"MainPage.cs");
Make sure that the event properties follow the below norms else, the properties won't be logged with the events.
- property key should not be more than 50 characters.
- property key should start with an alphabet.
- property key should not contain any space or special characters except underscore (_).
- property key should not start with 'ap_' or 'AP_'.
- property value can be a number (init, float, double, long), boolean, or string. Other data types such as JSONObject or JSONArray will be converted to string.
- property value length should not be more than 250 characters.
Logging defined events
Our SDK comes with a set of default events known as defined, available for your use once you have completed the SDK integration. These events are not tracked automatically.
AppticsWindowsBase.Enum.DefinedEvents is the endpoint for all the DefinedEvents.
You can use AppticsWindowsBase.AnalyticsHelper.AddEvent() method to track the defined events. Here is the list of all the defined events.
CopiedAppticsWindowsBase.Analytics.AnalyticsHelper.AddEvent(AppticsWindowsBase.Enum.DefinedEvents.AP_APPLICATION.AP_IN_APP_PURCHASE);
Group Name | Event Name |
---|---|
AP_APP_LIFE_CYCLE | AP_APP_INSTALL |
AP_APP_LIFE_CYCLE | AP_APP_UNINSTALL |
AP_APP_LIFE_CYCLE | AP_APP_UPDATE |
AP_APP_LIFE_CYCLE | AP_APP_CRACKED |
AP_APP_LIFE_CYCLE | AP_APP_OPEN |
AP_APP_LIFE_CYCLE | AP_APP_CLEAR_DATA |
AP_APP_LIFE_CYCLE | AP_APP_FOREGROUND |
AP_APP_LIFE_CYCLE | AP_APP_BACKGROUND |
AP_APP_LIFE_CYCLE | AP_APP_OUT_OF_MEMORY |
AP_APP_LIFE_CYCLE | AP_APP_FIRST_OPEN |
AP_APP_LIFE_CYCLE | AP_APP_LAUNCHING |
AP_APP_LIFE_CYCLE | AP_APP_RESIGN_ACTIVE |
AP_APP_LIFE_CYCLE | AP_APP_WILL_CONNECT |
AP_USER_LIFE_CYCLE | AP_USER_SIGNUP |
AP_USER_LIFE_CYCLE | AP_USER_LOGIN |
AP_USER_LIFE_CYCLE | AP_USER_LOGOUT |
AP_APPLICATION | AP_DEEP_LINK_OPEN |
AP_APPLICATION | AP_DEEP_LINK_UPDATE |
AP_APPLICATION | AP_DEEP_LINK_FIRST_OPEN |
AP_APPLICATION | AP_IN_APP_PURCHASE |
AP_APPLICATION | AP_NOTIFICATION_RECEIVE |
AP_APPLICATION | AP_NOTIFICATION_OPEN |
AP_APPLICATION | AP_NOTIFICATION_DISMISS |
AP_APPLICATION | AP_NOTIFICATION_FOREGROUND |
AP_APPLICATION | AP_SEARCH |
AP_APPLICATION | AP_BATTERY_LOW |
AP_APPLICATION | AP_BATTERY_FULL |
AP_APPLICATION | AP_LOW_POWER_MODE_ON |
AP_APPLICATION | AP_LOW_POWER_MODE_OFF |
AP_OTHERS | AP_NETWORK_REACHABILITY_CHANGE |
AP_OTHERS | AP_NETWORK_BANDWIDTH_CHANGE |
AP_OTHERS | AP_SWITCH_THEME_LIGHT |
AP_OTHERS | AP_SWITCH_THEME_DARK |
AP_OTHERS | AP_SWITCH_THEME_CUSTOM |
AP_OTHERS | AP_SWITCH_ORIENTATION_LANDSCAPE |
AP_OTHERS | AP_SWITCH_ORIENTATION_PORTRAIT |
AP_OS | AP_OS_UPDATE |
AP_OS | AP_OS_UNSUPPORTED |
Start a timed event
- To start a timed event, use the below snippet.
CopiedAppticsWindowsBase.Analytics.AnalyticsHelper.StartTimedEvent("bill", "mobile_number_change");
End a timed event
- To end a timed event, use the below snippet.
CopiedAppticsWindowsBase.Analytics.AnalyticsHelper.EndTimedEvent("bill", "mobile_number_change");