diff --git a/feature/src/main/java/com/terning/feature/search/search/SearchRoute.kt b/feature/src/main/java/com/terning/feature/search/search/SearchRoute.kt index 227ef863..d95786be 100644 --- a/feature/src/main/java/com/terning/feature/search/search/SearchRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/search/SearchRoute.kt @@ -22,6 +22,8 @@ import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.image.TerningImage import com.terning.core.designsystem.component.textfield.SearchTextField import com.terning.core.designsystem.theme.Black @@ -52,6 +54,8 @@ fun SearchRoute( val viewState by viewModel.viewState.collectAsStateWithLifecycle(lifecycleOwner = lifecycleOwner) val scrapState by viewModel.scrapState.collectAsStateWithLifecycle(lifecycleOwner = lifecycleOwner) + val amplitudeTracker = LocalTracker.current + LaunchedEffect(key1 = true) { viewModel.getSearchViews() viewModel.getSearchScraps() @@ -82,7 +86,13 @@ fun SearchRoute( modifier = modifier, searchViewsList = searchViewsList, searchScrapsList = searchScrapsList, - navigateToSearchProcess = navigateToSearchProcess, + navigateToSearchProcess = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "quest_search" + ) + navigateToSearchProcess() + }, navigateToIntern = navigateToIntern, onAdvertisementClick = { CustomTabsIntent.Builder().build().launchUrl(context, ADVERTISEMENT_URL.toUri())