NTP-32076 pass all event attributes in ads cc details screen click st… (#14698)
This commit is contained in:
@@ -10,10 +10,9 @@ package com.naviapp.adverse.creditcard.handler
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import com.navi.adverse.sdk.utils.AdverseTrackEvent
|
||||
import com.navi.common.utils.Constants.ADVERTISEMENT.AD_ID
|
||||
import com.navi.common.utils.Constants.ADVERTISEMENT.AD_VARIANT
|
||||
import com.navi.common.utils.Constants.ADVERTISEMENT.HORIZONTAL_RANK
|
||||
import com.navi.common.utils.Constants.ADVERTISEMENT.REWARD_TEXT
|
||||
import com.navi.common.utils.Constants.CLEAR_TASK
|
||||
import com.navi.common.utils.Constants.SCREEN_ID
|
||||
import com.navi.common.utils.filterLiteralNullValues
|
||||
import com.navi.uitron.model.action.AnalyticsAction
|
||||
import com.naviapp.adverse.creditcard.viewmodel.CreditCardScreenViewModel
|
||||
|
||||
@@ -42,10 +41,13 @@ fun getModifiedEventProperties(
|
||||
val queryMap = viewModel.queryMap
|
||||
val modifiedEventProperties = eventProperties?.toMutableMap() ?: mutableMapOf()
|
||||
|
||||
modifiedEventProperties[AD_ID] = queryMap[AD_ID].toString()
|
||||
queryMap[AD_VARIANT]?.let { modifiedEventProperties[AD_VARIANT] = it }
|
||||
queryMap[HORIZONTAL_RANK]?.let { modifiedEventProperties[HORIZONTAL_RANK] = it }
|
||||
queryMap[REWARD_TEXT]?.let { modifiedEventProperties[REWARD_TEXT] = it }
|
||||
queryMap.filterLiteralNullValues().also { filteredEntries ->
|
||||
modifiedEventProperties.putAll(filteredEntries)
|
||||
modifiedEventProperties.apply {
|
||||
remove(SCREEN_ID)
|
||||
remove(CLEAR_TASK)
|
||||
}
|
||||
}
|
||||
|
||||
return modifiedEventProperties
|
||||
}
|
||||
|
||||
@@ -262,6 +262,8 @@ object Constants {
|
||||
const val GET_MULTI_BOTTOMSHEET = "get_multi_bottomsheet"
|
||||
const val AMC_FUND_AUTOPAY_SETUP_V3 = "amc/fund/auto_pay_setup_v3"
|
||||
const val AUTOPAY_PAYMENT_CALLBACK_SYNC = "amc/checker/autopay_payment_callback_sync"
|
||||
const val NULL_STRING = "null"
|
||||
const val NULL_STRING_CAPS = "NULL"
|
||||
|
||||
/* Cta_Data */
|
||||
const val KEY_CTA_DATA = "CtaData"
|
||||
@@ -360,10 +362,6 @@ object Constants {
|
||||
object ADVERTISEMENT {
|
||||
const val AD_CLIENT = "ad_client"
|
||||
const val AD_CLIENT_REDIRECTION_URL = "ad_client_redirection_url"
|
||||
const val AD_ID = "ad_id"
|
||||
const val HORIZONTAL_RANK = "horizontal_rank"
|
||||
const val REWARD_TEXT = "reward_text"
|
||||
const val AD_VARIANT = "ad_variant"
|
||||
const val PAGE_LAUNCH_SOURCE = "page_launch_source"
|
||||
}
|
||||
|
||||
|
||||
@@ -74,6 +74,8 @@ import com.navi.common.listeners.ClickableTextListener
|
||||
import com.navi.common.network.models.RepoResult
|
||||
import com.navi.common.network.retrofit.RetrofitService
|
||||
import com.navi.common.utils.Constants.DEFAULT_ON_CLICK_DEBOUNCE_TIME
|
||||
import com.navi.common.utils.Constants.NULL_STRING
|
||||
import com.navi.common.utils.Constants.NULL_STRING_CAPS
|
||||
import com.navi.design.font.FontWeightEnum
|
||||
import com.navi.design.font.getFontStyle
|
||||
import com.navi.elex.theme.elexColors
|
||||
@@ -680,3 +682,8 @@ fun <K, V> Map<K, V>?.addKeyIfMissing(key: K, value: V): Map<K, V> {
|
||||
else -> this
|
||||
}
|
||||
}
|
||||
|
||||
fun <K> Map<K, String?>.filterLiteralNullValues(): Map<K, String> {
|
||||
return this.filter { entry -> entry.value !in listOf(null, NULL_STRING, NULL_STRING_CAPS) }
|
||||
.mapValues { it.value.orEmpty() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user