Skip to main content

Loyalty Ingest Events

Kenkai Android SDK Loyalty module consists of events for rewarding platforms. You need to implement this module if your app offers users some rewards, points on completing certain actions or achieving a certain milestone by using your app.

List of Events

Event NameTypeDescription
LevellevelTrack user's in-app loyalty level progress.
MilestonemilestoneTrack user's progress regarding achieving in-app loyalty milestone.
PromopromoTrack user's activity regarding promo section within app.
SurveysurveyTrack user's interaction with survey inside the app.
RewardrewardTrack user's interaction with rewards inside the app.


Level Event

To log the update of user level. It required the user level before update and user level after the update. You need to pass module id as well if the level update event is triggered because of the e-learning content block, any achievement in the e-learning platform.

Format

ParamUsabilityFormatEnum ValuesDescription
module_idREQUIREDSTRING---Id for the module in question, especially if the module is e-learning.
new_levelREQUIREDINT---Updated level score for the user's loyalty index.
prev_levelREQUIREDINT---Previous level score for the user's loyalty index.
metaOPTIONALANY---Any additional value that is sent with the log.

Usage

    val levelObject = LevelObject(
prevLevel = 4,
newLevel = 10,
moduleId = "testModuleId",
)

CFLoyaltyEvent.logIngest(
eventType = LoyaltyEventType.Level,
logObject = levelObject
)


Milestone Event

To log actions regarding milestones which can be when the user achieved a milestone.

Format

ParamUsabilityFormatEnum ValuesDescription
milestone_idREQUIREDSTRING---Id for the milestone user has achieved.
actionREQUIREDSTRINGachievedAction performed on the milestone.
metaOPTIONALANY---Any additional value that is sent with the log.

Usage

    val milestoneObject = MilestoneObject(
id = "testMilestoneId",
action = MilestoneAction.Achieved,
)

CFLoyaltyEvent.logIngest(
eventType = LoyaltyEventType.Milestone,
logObject = milestoneObject
)


Promo Event

To log the events associated of the promo lists and promo items and when they are clicked on.

Format

ParamUsabilityFormatEnum ValuesDescription
promo_idREQUIREDSTRING---Id for the promo user is viewing, applying.
actionREQUIREDSTRINGview, applyAction applied on promo by the user.
items_listREQUIREDARRAY (STRING)---List of IDs of the items in the promo list.
titleREQUIREDSTRING---Title for the promo list user is interacting with.
typeREQUIREDSTRINGadd_to_cart, couponType of promo user is interacting.
metaOPTIONALANY---Any additional value that is sent with the log.

Usage


val promoObject = PromoObject(
promoId = "testPromoId",
promoAction = PromoAction.Apply,
promoTitle = "Hello World",
promoType = PromoType.AddToCart,
promoItemsList = listOf("Hello", "World"),
)

CFLoyaltyEvent.logIngest(
eventType = LoyaltyEventType.Promo,
logObject = promoObject
)


Survey Event

To log actions regarding interactions with surveys inside the app.

Format

ParamUsabilityFormatEnum ValuesDescription
survey_idREQUIREDSTRING---ID of the survey
actionREQUIREDSTRINGview, impression, start, submitAction on the survey
is_completedREQUIREDBOOLEAN---Is Survey Completed?
reward_idOPTIONALSTRING---ID of the Reward
typeOPTIONALSTRINGopen_ended, closed_ended, nominal, likert_scale, rating_scale, yes_no, interview, otherType of the Reward
survey_questionsOPTIONALARRAY (STRING)---List of Questions in the Survey
response_listOPTIONALARRAY (STRING)---List of Responses in the Survey
metaOPTIONALANY---Any additional value that is sent with the log

Usage

    val surveyItem = SurveyEventObject(
action = SurveyAction.Submit,
id = "Some SurveyId",
isCompleted = true,
rewardId = "testRewardId",
type = SurveyType.OpenEnded,
surveyQuestions = listOf(
"Some Question Text 1",
"Some Question Text 2",
),
responseList = listOf(
"Some Answer Text 1",
"Some Answer Text 2",
)
)

CFLoyaltyEvent.logIngest(
eventType = LoyaltyEventType.Survey,
logObject = surveyItem
)



Reward Event

To log actions regarding interactions with rewards inside the app.

Format

ParamUsabilityFormatEnum ValuesDescription
reward_idREQUIREDSTRING---Id of the reward
actionREQUIREDSTRINGview, add, redeemAction on the reward
acc_pointsOPTIONALFLOAT---Points achieved for the reward. Only required for add type
total_pointsREQUIREDFLOAT---Total points of user including the acc_points
redeem_typeREQUIREDSTRINGcash, airtime, otherType of redeem
redeem_points_withdrawnREQUIREDFLOAT---Redeemed points of redeem
redeem_converted_valueREQUIREDFLOAT---Converted Value of redeem points
redeem_currencyREQUIREDFLOAT---Currency of the redeemed value
redeem_is_successfulREQUIREDBOOLEAN---If the redeem was successful
metaOPTIONALANY---Any additional value that is sent with the log

Usage

     val rewardObject = RewardEventObject(
rewardId = "testRewardId",
action = RewardAction.Redeem,
totalPoints = 22f,
redeemType = RedeemType.Cash,
redeemPointsWithdrawn = 0.1f,
redeemConvertedValue = 2.3f,
redeemCurrency = CurrencyCode.USD,
redeemIsSuccessful = true
)
CFLoyaltyEvent.logIngest(
eventType = LoyaltyEventType.Reward,
logObject = rewardObject
)