Tracking in app
If you are currently using tracking from Firebase, you need to replace all of them and use tracking from the SDK system.
Class Index com.ikame.android.sdk.tracking.IKTrackingHelper
sendTracking
sendTracking(eventName: String, vararg param: Pair<String, String?>)
OR
sendTracking(eventName: String, bundle: Bundle)
Parameters:
-
eventName: The name of the event you want to track. -
param: Optional parameters to provide additional details about the event. Each parameter is a key-value pair where the key is a String describing the parameter, and the value is a nullable String containing the parameter’s value.
Sample usage
logCrash
In the Crashlytics dashboard, you can click into an issue and get a detailed event report. Use this function to report exceptions to Crashlytics.
fun logCrash(message: String, throwable: Throwable)
sendTrackingPermission
Trigger: Sends tracking information related to permission events.
fun sendTrackingPermission(
actionName: IKTrackingConst.PermissionActionName,
from: String?,
permissionName: String?,
status: IKTrackingConst.PermissionStatus?
)
Parameters:
-
actionNameThe action name for the permission event. -
fromThe source or context of the permission request (e.g., “popup”). -
permissionNameThe name of the permission being requested. -
statusThe status of the permission (e.g., “yes”, “no”).
OR
fun sendTrackingPermission(
actionName: IKTrackingConst.PermissionActionName,
from: String?,
permissionName: String?
)
Parameters:
-
actionNameThe action name for the permission event. -
fromThe source or context of the permission request (e.g., “popup”). -
permissionNameThe name of the permission being requested.
sendTrackingNotification
Trigger: Sends tracking information related to notification events.
fun sendTrackingNotification(
actionName: IKTrackingConst.NotificationActionName,
notifyType: String?,
notifyContent: String?
)
Parameters:
-
actionNameThe action name for the notification event. -
notifyTypeThe type of notification. -
notifyContentThe content of the notification.
sendTrackingFeedback
Trigger: Sends tracking information related to feedback events.
fun sendTrackingFeedback(
actionName: IKTrackingConst.FeedbackActionName,
value: String?
)
Parameters:
-
actionNameThe action name for the feedback event. -
valueThe feedback value.
setCrashlyticsCustomKeys
Trigger: Sets custom keys for Crashlytics reporting.
fun setCrashlyticsCustomKeys(vararg param: Pair<String, Any>)
Parameters:
paramPairs of key-value pairs to be set as custom keys.
sendTrackingApi
Trigger: Sends tracking information related to API events.
fun sendTrackingApi(
actionName: IKTrackingConst.ApiActionName,
apiName: String?,
endpoint: String?,
method: String?,
internetStatus: String?,
)
Parameters:
-
actionNameThe action name for the API event. -
apiNameThe name of the API (e.g., “chat_ai”, “plant_identify”, “phone_tracker”). -
endpointThe URL of the API (e.g., “api/auth/local”). -
methodThe HTTP method of the API (e.g., “GET”, “POST”, “DELETE”, “PUT”, “PATCH”, “OPTIONS”). -
internetStatusThe status of the internet connection (e.g., “yes”, “no”).
OR
fun sendTrackingApi(
actionName: IKTrackingConst.ApiActionName,
apiName: String?,
endpoint: String?,
method: String?,
responseCode: String?,
responseNull: String?,
responseDuration: String?,
)
Parameters:
-
actionNameThe action name for the API event. -
apiNameThe name of the API (e.g., “chat_ai”, “plant_identify”, “phone_tracker”). -
endpointThe URL of the API (e.g., “api/auth/local”). -
methodThe HTTP method of the API (e.g., “GET”, “POST”, “DELETE”, “PUT”, “PATCH”, “OPTIONS”). -
responseCodeThe HTTP status code returned by the API (e.g., “200”, “400”, “401”). -
responseNullIndicates whether the response is null (e.g., “yes”, “no”). -
responseDurationThe duration of the API call in milliseconds (e.g., “12345”).
sendTrackingUserInfo
Trigger: Sends tracking information related to User Info events.
fun sendTrackingUserInfo(
actionName: IKTrackingConst.InfoActionName,
groupAge: String?,
gender: String?,
favorite: String?,
)
Parameters:
-
actionNameThe action name for the User Info event. -
groupAgeThe age group of the user (e.g., “13”, “14”, “15”). -
genderThe gender of the user (e.g., “male”, “female”, “other”). -
favoriteThe favorite of the user (e.g., “reading”, “hiking”).