Skip to main content

Core Ingest Events

Core content block mainly focus on events related to app navigation of your application, such as events related to app -> app opening, app closing or moving to background. Also for the screen related events, how much time a user spends on a screen and also some basic functional events as well such as login, media related or search related events.

List of Events

Here's a list of events that can be tracked using the core module:

Event NameTypeDescription
AppappTrack when the user opens/resumes/background/closes the app. (Auto Tracked)
PagepageTrack screen/activity changes along with session timing. (Auto Tracked)
IdentifyidentifyTrack when user register/login/logout from the app.
MediamediaTrack how your users interact with media to offer better
SearchsearchTrack how search responds to user queries.
RaterateTrack user ratings on different elements in the app.
Module Selectionmodule_selectionTrack when a module is selected on the main screen.
Track EventtrackAllows partners to send custom events as specified for their special cases.
Action Responseaction_responseTrack how user reacted to the action.


App Event

To Log application-related events regarding the user opening, resuming, closing the app, or putting the app in the background.

"Auto-Tracked"

This is an auto-tracked event, you don't need to add anything to trigger this event.

Overview

ParamUsabilityFormatEnum ValuesDescription
actionREQUIREDSTRINGopen, close, resume, backgroundIdentify action for which the event is triggered.
start_timeREQUIREDINTEGER---Time the app took to open, render the first page. Calculated in milliseconds. Will be 0 for all app actions except app_open.
metaOPTIONALANY---Any additional value that is sent with the log.

Usage

    {
"name": "app",
"property": "open",
"ctx": {
"__ol": true,
"action": "open",
"start_time": "122"
}
}


Page Event

To Log screen viewing events that record when a screen is shown to the user. By default, SDK auto listens for page changes in the app.

"Auto-Tracked for Android Native and Web Applications"

This is an auto-tracked event, you don't need to add anything to trigger this event on Android Native and Web Applications. However, if you are using custom navigation graph in Android or React Native, then you need to use this event specifically with your route information.

Overview

ParamUsabilityFormatEnum ValuesDescription
pathREQUIREDSTRING--The path of the screen in the application.
titleREQUIREDSTRING--The title of the screen in the application.
render_timeREQUIREDINTEGER--The duration in milliseconds, the time it takes for the page to render the content on screen.
metaOPTIONALANY---Any additional value that is sent with the log.

Usage

    CFCoreEvent.logIngest(
CoreEventType.Page,
logObject = PageObject(
path = activity.packageName,
title = activity.localClassName,
renderTime = renderTime,
)
)

Also disable the default page tracking in the CFLog.Builder() using .disableAutoPageTrack()



Identify Event

To Log identity events regarding the user of the app such as register, login, or log out you can use Identity log events that are divided into 3 different types.

Overview

ParamUsabilityFormatEnum ValuesDescription
actionREQUIREDSTRINGregister, login, logout, blocked, unblockedIdentify action for which the event is triggered.
referral_codeOPTIONALSTRING---Referral code used by the app user on registration.
blocked_reasonOPTIONALSTRING---blocked reason if the user is blocked from accessing the app
blocked_remarksOPTIONALSTRING---blocked remarks if the user is blocked from accessing the app

Usage

    CFCoreEvent.logIngest(
eventType = CoreEventType.Identify,
logObject = IdentifyObject(
userId = Common.testUserId,
action = IdentifyAction.Login,
referralCode = "ASDDSA"
)
)

To log user Catalog Properties: User Catalog



Media Event

To Log media events regarding the use of multimedia elements in the app. This can be images, videos, or audio. The event logs elements regarding play, pause, view, seek or finish of the event.

Overview

ParamUsabilityFormatEnum ValuesDescription
media_idREQUIREDSTRING--Id for the media in question.
typeREQUIREDSTRINGvideo, audio, imagetype for the media in question.
actionREQUIREDSTRINGview, play, pause, seek, finish, impressionaction performed on the media in question.
seek_timeREQUIREDINTEGER--currentSeekTime of the media (Duration in Millisecond) when an action is performed.
metaOPTIONALANY---Any additional value that is sent with the log.

Usage

    CFCoreEvent.logIngest(
eventType = CoreEventType.Media,
logObject = MediaObject(
mediaId = "mediaId",
mediaType = MediaType.Video,
mediaAction = MediaAction.Pause,
seekTime = 1234556
)
)


Search Event

To Log search events regarding the use of search in the app. This refers to the use of search-related parameters in the app. From search results to the filters and the page number of the search API (if any).

Overview

ParamUsabilityFormatEnum ValuesDescription
queryREQUIREDSTRING--Query on which the Search is performed.
moduleREQUIREDSTRINGcore, e_commerce, e_learning, screening, assessment, enrolment, medical_review, my_patients, appointments, prescription, lifestyle_mgmt, psychological_mgmt, counseling_mgmt, investigation, treatment_plan, transfers, otherModule on which the search is performed.
pageREQUIREDINTEGER--API page of the search results. default to 1
filterOPTIONALHASHMAP(STRING, Any)--Key value pair for the filters if any applied on the search.
results_listREQUIREDARRAY (STRING)--Array of IDs for the search results.
metaOPTIONALANY---Any additional value that is sent with the log.

Usage

    val resultItems: List<String> = listOf("item ID 1", "item ID 2")

val filtersHashMap: HashMap<String, String> = HashMap()
filtersHashMap.put("filterName", "filterValue")

CFCoreEvent.logIngest(
eventType = CoreEventType.Search,
logObject = SearchObject(
query = "some Query",
searchModule = ModuleType.Core,
resultsList = resultItems,
filter = filtersHashMap,
page = 1
)
)


Rate Event

To Log Rate events on elements inside the application. Such elements can be an order, app rating itself or a service offered in the app.

Overview

ParamUsabilityFormatEnum ValuesDescription
rate_valueREQUIREDFLOAT---For providing the value for the rate. Should be in between 0 to 5
typeREQUIREDSTRINGorder, item, media, exam, question, module, process, form, section, app, hcw, hcw_site, facility, assessment, customer, otherFor providing the type of the element being rated.
subject_idREQUIREDSTRING---To set the subject Id for the item being rated based on the type above.
metaOPTIONALANY---Any additional value that is sent with the log.

Usage

    CFCoreEvent.logIngest(
eventType = CoreEventType.Rate,
logObject = RateObject(
rateValue = 4f,
type = RateType.Order,
subjectId = "testOrderId",
)
)


Module Selection Event

To log module selection. You can select the module type with the log values.

Format

ParamUsabilityFormatEnum ValuesDescription
typeREQUIREDSTRINGscreening, assessment, enrolment, medical_review, my_patients, prescription, counseling_mgmt, lifestyle_mgmt, psychological_mgmt, investigation, appointment, hcw_mgmt, treatment_plan, transfers, appointment, hcw_mgmt, break, caller_history, attend_call, single, dashboard, map, othercurrent module selected by the user in the patient mgmt section on the main screen.
metaOPTIONALANY---Any additional value that is sent with the log.

Usage

      CFCoreEvent.logIngest(
eventType = CoreEventType.ModuleSelection,
logObject = ModuleSelectionObject(
type = ModuleType.Screening
)
)


Track Event

To log custom events based on specified use cases.

Format

ParamUsabilityFormatEnum ValuesDescription
nameREQUIREDSTRING---name of the event, should not match with predefines SDK events.
propertyOPTIONALSTRING---String based property for the event associated to the event.
metaOPTIONALMAP (STRING, ANY)---Key Value pair of properties for the events, where any is of primitive types.

Usage

      CFCoreEvent.logIngest(
eventType = CoreEventType.Track,
logObject = TrackEventObject(
name = "custom_event",
property = "testValue",
meta = mapOf(
"SomeKey" to "SomeValue",
"SomeKey2" to 22,
)
)
)


Action CTA Event

Recommendations based actions provide payload in the response, which can be used to trigger the CTA event. The CTA event can be to open a certain page in the app or to perform a certain action such as adding an item to the cart directly.

Callback Event

This is a callback event, you need to process the response based on your app architecture and handle the action accordingly.

Overview

ParamFormatDescription
cta_typeSTRINGAction to be performed as a part of the recommendation - redirect/add-to_cart
cta_idSTRINGid of the product being recommended.

Usage


class MyApplication : Application(), LifecycleEventObserver, ActionOnClickInterface {

override fun onCreate() {
super.onCreate()
ActionOnClickObject.actionOnClickInterface = this
}

override fun onActionOpened(actionAttributes : Map<String, String>) {
Log.d("Notification Opened", "Notification Opened: ${actionAttributes["cta_type"]} \n ${actionAttributes["cta_id"]} \n $actionAttributes")
Toast.makeText(this,
"Notification Opened\", \"Notification Opened: ${actionAttributes["cta_type"]} \\n ${actionAttributes["cta_id"]} \\n $actionAttributes", Toast.LENGTH_LONG).show()

}
}



Action Response Event

To Log responses on actions, we use the same ingest API and send the user's response there.

"Auto-Tracked"

This is an auto-tracked event, you don't need to add anything to trigger this event.

Overview

ParamUsabilityFormatEnum ValuesDescription
refREQUIREDSTRING--Intervention ref string provided in the request API
timeREQUIREDSTRING--Time parameter provided by the request API.
responseREQUIREDSTRINGopen, discard, block, shown, expired, errorAction of the user performed on the action.

Usage


{
"name": "action_response",
"property": "open",
"props": {
"response": "open",
"internal": {...internal object from request}
}
}


Manage Auto Show InApp Actions

To show in-app messages on the screen of your choice, you can disable the auto show from the SDK initialisation as:

    CFLog.Builder()
.init(this) // pass in the context
...
.setAutoShowInAppMessage(autoShowInAppMessage = false) // use this and set the autoShowInAppMessage to false
...
.build()

then in your activity where you want to show the in-app message, you can show the nudge by using:

    CFCoreEvent.showInAppMessage(ActionScreenType.Cart.toString()) // ActionScreenType is an enum provided in the SDK


Fetch Actions for UI Interventions

To show in-app messages on the screen of your choice, you can disable the auto show from the SDK initialisation as:

    CFCoreEvent.fetchActions(
invActionType = InvActionType.UIComponent,
actionRenderMethodType = ActionRenderMethodType.InAppComponent,
deliveryMode = ActionDeliveryMode.OneOff,
actionAttr = mapOf( "hello" to "world" ),
onResult = {
Toast.makeText(this, "CFCoreEvent.fetchActions", Toast.LENGTH_SHORT).show()
}
)