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

Copied[APEvent trackEvent:<#(nonnull NSString *)#> andGroupName:<#(nonnull NSString *)#>]
CopiedAPEvent.trackEvent(<#T##eventName: String##String#>, withGroupName: <#T##String#>)

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 NSDictionary or Dictionary.
  • To add the custom properties, call the below method.
Copied[APEvent trackEvent:<#(nonnull NSString *)#> andGroupName:<#(nonnull NSString *)#> withProperties:<#(nonnull NSDictionary *)#>]
CopiedAPEvent.trackEvent(<#T##eventName: String##String#>, andGroupName: <#T##String#>, withProperties: <#T##[AnyHashable : Any]#>)

Sample snippet to use properties.

CopiedNSDictionary *prop=@{@"item":@"Box",@"quantity":10};

[APEvent trackEvent:@"event_name" andGroupName:@"group_name" withProperties:prop];
Copiedlet prop=["item":"Box","quantity":10]

APEvent.trackEvent("event_name", andGroupName: "group_name", withProperties: prop)

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 timed events

  • To log the timed events, call the startTimedEvent method.
Copied[APEvent startTimedEvent:<#(nonnull NSString *)#> group:<#(nonnull NSString *)#> andProperties:<#(nonnull NSDictionary *)#>]
CopiedAPEvent.startTimedEvent(<#T##eventName: String##String#>, group: <#T##String#>, andProperties: <#T##[AnyHashable : Any]#>)
  • Calling the endTimedEvent method will end the timer of the specific event.
Copied[APEvent endTimedEvent:<#(NSString * _Nonnull)#> withGroup:<#(NSString * _Nonnull)#>]
CopiedAPEvent.endTimedEvent(<#T##eventName: String##String#>, withGroup: <#T##String#>)

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. Some of these events are tracked automatically (please see the automatic events).

The defined events are available as a constant string in our SDK and you can pass them to the trackEvent method.

Copied[APEvent trackEvent:AP_IN_APP_PURCHASE andGroupName:AP_APPLICATION];
CopiedAPEvent.trackEvent(AP_APPLICATION, andGroupName: AP_IN_APP_PURCHASE)

Enable automatic tracking

To track the events automatically, set enableAutomaticEventTracking to true just before you initialize Apptics.

Copied[[AppticsConfig defaultConfig] enableAutomaticEventTracking] = TRUE;
CopiedAppticsConfig.default.enableAutomaticEventTracking = true

A list of all the defined events.

Group nameEvent nameAuto tracked
AP_GROUP_APP_LIFE_CYCLEAP_EVENT_APP_INSTALLNo
AP_GROUP_APP_LIFE_CYCLEAP_EVENT_APP_UNINSTALLNo
AP_GROUP_APP_LIFE_CYCLEAP_EVENT_APP_UPDATENo
AP_GROUP_APP_LIFE_CYCLEAP_EVENT_APP_CRACKEDNo
AP_GROUP_APP_LIFE_CYCLEAP_EVENT_APP_OPENNo
AP_GROUP_APP_LIFE_CYCLEAP_EVENT_APP_CLEAR_DATAYes
AP_GROUP_APP_LIFE_CYCLEAP_EVENT_APP_FOREGROUNDYes
AP_GROUP_APP_LIFE_CYCLEAP_EVENT_APP_BACKGROUNDYes
AP_GROUP_APP_LIFE_CYCLEAP_EVENT_APP_OUT_OF_MEMORYYes
AP_GROUP_APP_LIFE_CYCLEAP_EVENT_APP_FIRST_OPENYes
AP_GROUP_APP_LIFE_CYCLEAP_EVENT_APP_LAUNCHINGYes
AP_GROUP_APP_LIFE_CYCLEAP_EVENT_APP_RESIGN_ACTIVEYes
AP_GROUP_APP_LIFE_CYCLEAP_EVENT_APP_WILL_CONNECTYes
AP_GROUP_USER_LIFE_CYCLEAP_EVENT_USER_SIGNUPYes
AP_GROUP_USER_LIFE_CYCLEAP_EVENT_USER_LOGINYes
AP_GROUP_USER_LIFE_CYCLEAP_EVENT_USER_LOGOUTYes
AP_GROUP_APPLICATIONAP_EVENT_DEEP_LINK_OPENNo
AP_GROUP_APPLICATIONAP_EVENT_DEEP_LINK_UPDATENo
AP_GROUP_APPLICATIONAP_EVENT_DEEP_LINK_FIRST_OPENNo
AP_GROUP_APPLICATIONAP_EVENT_IN_APP_PURCHASENo
AP_GROUP_APPLICATIONAP_EVENT_NOTIFICATION_RECEIVENo
AP_GROUP_APPLICATIONAP_EVENT_NOTIFICATION_OPENNo
AP_GROUP_APPLICATIONAP_EVENT_NOTIFICATION_DISMISSNo
AP_GROUP_APPLICATIONAP_EVENT_NOTIFICATION_FOREGROUNDNo
AP_GROUP_APPLICATIONAP_EVENT_SEARCHNo
AP_GROUP_APPLICATIONAP_EVENT_BATTERY_LOWYes
AP_GROUP_APPLICATIONAP_EVENT_BATTERY_FULLYes
AP_GROUP_APPLICATIONAP_EVENT_LOW_POWER_MODE_ONYes
AP_GROUP_APPLICATIONAP_EVENT_LOW_POWER_MODE_OFFYes
AP_GROUP_OTHERSAP_EVENT_NETWORK_REACHABILITY_CHANGENo
AP_GROUP_OTHERSAP_EVENT_NETWORK_BANDWIDTH_CHANGENo
AP_GROUP_OTHERSAP_EVENT_SWITCH_THEME_LIGHTYes
AP_GROUP_OTHERSAP_EVENT_SWITCH_THEME_DARKYes
AP_GROUP_OTHERSAP_EVENT_SWITCH_THEME_CUSTOMNo
AP_GROUP_OTHERSAP_EVENT_SWITCH_ORIENTATION_LANDSCAPEYes
AP_GROUP_OTHERSAP_EVENT_SWITCH_ORIENTATION_PORTRAITYes
AP_GROUP_OSAP_EVENT_OS_UPDATENo
AP_GROUP_OSAP_EVENT_OS_UNSUPPORTEDNo