NTP-46717 | Events instrumentation (#15361)
This commit is contained in:
committed by
GitHub
parent
3cfe3d7e24
commit
f26c2c09d4
@@ -15,6 +15,8 @@ import { CtaData } from "../../../../common/interface";
|
||||
import { ScreenData } from "../../../../common/interface/widgets/screenData/ScreenData";
|
||||
import { globalHandleClick } from "../../../../common/utilities/NavigationUtil";
|
||||
import { styles } from "./QuoteApologyScreenStyle";
|
||||
import { useAnalyticsEvent } from "../../../../common/hooks";
|
||||
import { screenEvents } from "./types";
|
||||
|
||||
const QuoteApologyScreen = ({
|
||||
ctaData,
|
||||
@@ -25,6 +27,8 @@ const QuoteApologyScreen = ({
|
||||
screenData: ScreenData | null;
|
||||
handleActions: (screenPayload?: GenericActionPayload) => void;
|
||||
}) => {
|
||||
const { sendAsAnalyticsEvent } = useAnalyticsEvent();
|
||||
sendAsAnalyticsEvent(screenEvents);
|
||||
const navigation = useNavigation();
|
||||
const handleClick = (cta?: CtaData) => {
|
||||
globalHandleClick(navigation, cta, QUOTE_APOLOGY_SCREEN);
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import {
|
||||
AnalyticsEventNameConstants,
|
||||
AnalyticsFlowNameConstant,
|
||||
} from "../../../../common/constants";
|
||||
import { AnalyticsEvent } from "../../../../common/interface";
|
||||
import { ScreenState } from "../../../../common/screen/BaseScreen";
|
||||
|
||||
export const screenEvents: AnalyticsEvent = {
|
||||
name: AnalyticsEventNameConstants.HI_RN_QUOTE_APOLOGY_PAGE_INIT,
|
||||
properties: {
|
||||
screen: AnalyticsFlowNameConstant.GI_RN_QUOTE,
|
||||
},
|
||||
};
|
||||
@@ -1,6 +1,7 @@
|
||||
export const AnalyticsEventNameConstants = {
|
||||
HI_SI_PILLS_CLICK: "hi_si_pills_click",
|
||||
HI_RN_QUOTE_PAGE_INIT: "hi_rn_quote_page_init",
|
||||
HI_RN_QUOTE_APOLOGY_PAGE_INIT: "hi_rn_quote_apology_page_init",
|
||||
HI_RN_GRATIFICATION_SCREEN_INIT: "hi_pre_quote_generating_screen_init",
|
||||
HI_RN_QUOTE_PAGE_ERROR_VIEW: "hi_rn_quote_page_error_view",
|
||||
HI_RN_BENEFIT_COMPARE_PAGE_INIT: "hi_rn_benefit_compare_page_init",
|
||||
|
||||
@@ -30,6 +30,7 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import com.navi.analytics.utils.NaviTrackEvent
|
||||
import com.navi.base.model.CtaData
|
||||
import com.navi.base.model.CtaType
|
||||
import com.navi.base.utils.isNotNull
|
||||
@@ -122,6 +123,19 @@ fun PolicyReviewScreen(
|
||||
when (pageResponseState.value) {
|
||||
is ResponseState.Success -> {
|
||||
val successResponse = (pageResponseState.value as? ResponseState.Success)?.value
|
||||
if (
|
||||
successResponse?.redirectionCta == null &&
|
||||
successResponse?.pageMetaData?.analyticsEvents.isNotNull()
|
||||
) {
|
||||
successResponse?.pageMetaData?.analyticsEvents?.forEach {
|
||||
NaviTrackEvent.trackEvent(
|
||||
it.name.orEmpty(),
|
||||
it.properties,
|
||||
it.isNeededForAppsflyer.orFalse(),
|
||||
it.isNeededForFirebase.orFalse(),
|
||||
)
|
||||
}
|
||||
}
|
||||
if (successResponse?.redirectionCta != null) {
|
||||
widgetCallback.onClick(successResponse.redirectionCta)
|
||||
} else if (nextPageResponseState.value is ResponseState.Success) {
|
||||
|
||||
@@ -10,6 +10,7 @@ package com.navi.insurance.review_policy.model.response
|
||||
import android.os.Parcelable
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import com.navi.base.model.CtaData
|
||||
import com.navi.insurance.common.models.PageMetaData
|
||||
import com.navi.naviwidgets.models.FooterButtonState
|
||||
import com.navi.naviwidgets.models.response.FloatingButtonData
|
||||
import com.navi.naviwidgets.models.response.ImageFieldData
|
||||
@@ -34,6 +35,7 @@ data class PolicyReviewPageResponse(
|
||||
@SerializedName("footer") val footer: PolicyReviewFooter? = null,
|
||||
@SerializedName("floatingButtonData")
|
||||
val floatingButtonData: @RawValue FloatingButtonData? = null,
|
||||
@SerializedName("pageMetaData") val pageMetaData: @RawValue PageMetaData? = null,
|
||||
) : Parcelable {
|
||||
|
||||
@Parcelize
|
||||
|
||||
Reference in New Issue
Block a user