diff --git a/core/src/main/java/com/terning/core/analytics/EventType.kt b/core/src/main/java/com/terning/core/analytics/EventType.kt index ec270bc4b..ad4be9102 100644 --- a/core/src/main/java/com/terning/core/analytics/EventType.kt +++ b/core/src/main/java/com/terning/core/analytics/EventType.kt @@ -1,6 +1,8 @@ package com.terning.core.analytics enum class EventType(val prefix: String) { - VIEW("view"), - CLICK("click") + SIGNUP("signup"), + SCREEN("screen"), + CLICK("click"), + SCROLL("scroll") } diff --git a/feature/src/main/java/com/terning/feature/calendar/calendar/CalendarRoute.kt b/feature/src/main/java/com/terning/feature/calendar/calendar/CalendarRoute.kt index fd8e24bd2..b6bee6d7d 100644 --- a/feature/src/main/java/com/terning/feature/calendar/calendar/CalendarRoute.kt +++ b/feature/src/main/java/com/terning/feature/calendar/calendar/CalendarRoute.kt @@ -22,6 +22,8 @@ import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.topappbar.CalendarTopAppBar import com.terning.core.designsystem.theme.Grey200 import com.terning.core.designsystem.theme.White @@ -45,6 +47,7 @@ fun CalendarRoute( ) { val lifecycleOwner = LocalLifecycleOwner.current val uiState by viewModel.uiState.collectAsStateWithLifecycle(lifecycleOwner = lifecycleOwner) + val amplitudeTracker = LocalTracker.current CalendarScreen( modifier = modifier, @@ -54,7 +57,15 @@ fun CalendarRoute( updateSelectedDate = viewModel::updateSelectedDate, disableListVisibility = { viewModel.updateListVisibility(false) }, disableWeekVisibility = { viewModel.updateWeekVisibility(false) }, - onClickListButton = { viewModel.updateListVisibility(!uiState.isListEnabled) } + onClickListButton = { + if (!uiState.isListEnabled) { + amplitudeTracker.track( + type = EventType.CLICK, + name = "calendar_list" + ) + } + viewModel.updateListVisibility(!uiState.isListEnabled) + } ) } @@ -132,7 +143,7 @@ private fun CalendarScreen( CalendarMonthRoute( selectedDate = uiState.selectedDate, updateSelectedDate = { newDate -> - if(!pagerState.isScrollInProgress) + if (!pagerState.isScrollInProgress) onClickNewDate(newDate) }, modifier = Modifier diff --git a/feature/src/main/java/com/terning/feature/dialog/cancel/ScrapCancelDialog.kt b/feature/src/main/java/com/terning/feature/dialog/cancel/ScrapCancelDialog.kt index 9700fa9e4..cc4e03004 100644 --- a/feature/src/main/java/com/terning/feature/dialog/cancel/ScrapCancelDialog.kt +++ b/feature/src/main/java/com/terning/feature/dialog/cancel/ScrapCancelDialog.kt @@ -19,6 +19,8 @@ import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.flowWithLifecycle +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.button.RoundButton import com.terning.core.designsystem.component.dialog.TerningBasicDialog import com.terning.core.designsystem.component.item.TerningLottieAnimation @@ -37,13 +39,16 @@ fun ScrapCancelDialog( ) { val context = LocalContext.current val lifecycleOwner = LocalLifecycleOwner.current + val amplitudeTracker = LocalTracker.current + LaunchedEffect(viewModel.sideEffect, lifecycleOwner) { viewModel.sideEffect.flowWithLifecycle(lifecycle = lifecycleOwner.lifecycle) - .collect{ sideEffect -> - when(sideEffect){ + .collect { sideEffect -> + when (sideEffect) { is ScrapCancelSideEffect.DismissDialog -> { onDismissRequest(true) } + is ScrapCancelSideEffect.ShowToast -> { context.toast(sideEffect.message) } @@ -53,7 +58,13 @@ fun ScrapCancelDialog( ScrapCancelScreen( onDismissRequest = { onDismissRequest(false) }, - onClickScrapCancel = { viewModel.deleteScrap(internshipAnnouncementId) } + onClickScrapCancel = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "detail_cancel_scrap" + ) + viewModel.deleteScrap(internshipAnnouncementId) + } ) } @@ -66,48 +77,48 @@ private fun ScrapCancelScreen( TerningBasicDialog( onDismissRequest = onDismissRequest ) { - Column( + Column( + modifier = Modifier + .fillMaxWidth() + .wrapContentHeight() + .padding(top = 60.dp) + .padding(horizontal = 16.dp), + horizontalAlignment = Alignment.CenterHorizontally + ) { + TerningLottieAnimation( + jsonString = "terning_scrap_cancel.json", modifier = Modifier .fillMaxWidth() - .wrapContentHeight() - .padding(top = 60.dp) - .padding(horizontal = 16.dp), - horizontalAlignment = Alignment.CenterHorizontally - ) { - TerningLottieAnimation( - jsonString = "terning_scrap_cancel.json", - modifier = Modifier - .fillMaxWidth() - .height(203.dp) - ) + .height(203.dp) + ) - Spacer(modifier = Modifier.height(20.dp)) + Spacer(modifier = Modifier.height(20.dp)) - Text( - text = stringResource(id = R.string.dialog_content_scrap_cancel_main_title), - textAlign = TextAlign.Center, - style = TerningTheme.typography.title4, - color = Grey500, - ) + Text( + text = stringResource(id = R.string.dialog_content_scrap_cancel_main_title), + textAlign = TextAlign.Center, + style = TerningTheme.typography.title4, + color = Grey500, + ) - Spacer(modifier = Modifier.height(5.dp)) + Spacer(modifier = Modifier.height(5.dp)) - Text( - text = stringResource(id = R.string.dialog_content_scrap_cancel_sub_title), - style = TerningTheme.typography.body5, - color = Grey350 - ) - Spacer(modifier = Modifier.height(40.dp)) + Text( + text = stringResource(id = R.string.dialog_content_scrap_cancel_sub_title), + style = TerningTheme.typography.body5, + color = Grey350 + ) + Spacer(modifier = Modifier.height(40.dp)) - RoundButton( - style = TerningTheme.typography.button3, - paddingVertical = 12.dp, - cornerRadius = 8.dp, - text = R.string.dialog_scrap_cancel_button, - onButtonClick = onClickScrapCancel - ) - Spacer(modifier = Modifier.height(16.dp)) - } + RoundButton( + style = TerningTheme.typography.button3, + paddingVertical = 12.dp, + cornerRadius = 8.dp, + text = R.string.dialog_scrap_cancel_button, + onButtonClick = onClickScrapCancel + ) + Spacer(modifier = Modifier.height(16.dp)) + } } } diff --git a/feature/src/main/java/com/terning/feature/dialog/detail/ScrapDialog.kt b/feature/src/main/java/com/terning/feature/dialog/detail/ScrapDialog.kt index 86e9e171d..8e64ca236 100644 --- a/feature/src/main/java/com/terning/feature/dialog/detail/ScrapDialog.kt +++ b/feature/src/main/java/com/terning/feature/dialog/detail/ScrapDialog.kt @@ -36,6 +36,8 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle import coil3.compose.AsyncImage import coil3.request.ImageRequest +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.button.RoundButton import com.terning.core.designsystem.component.dialog.TerningBasicDialog import com.terning.core.designsystem.theme.Grey100 @@ -73,6 +75,8 @@ fun ScrapDialog( val context = LocalContext.current val lifecycleOwner = LocalLifecycleOwner.current val uiState by viewModel.uiState.collectAsStateWithLifecycle(lifecycleOwner = lifecycleOwner) + val amplitudeTracker = LocalTracker.current + LaunchedEffect(viewModel.sideEffect, lifecycleOwner) { viewModel.sideEffect.flowWithLifecycle(lifecycle = lifecycleOwner.lifecycle) .collect { sideEffect -> @@ -123,21 +127,29 @@ fun ScrapDialog( isColorChanged = uiState.isColorChanged, onClickColorButton = viewModel::changeSelectedColor, onClickColorChangeButton = { - if (uiState.isColorChanged) + if (uiState.isColorChanged) { + amplitudeTracker.track( + type = EventType.CLICK, + name = "modal_color" + ) viewModel.patchScrap( scrapId = internshipAnnouncementId, color = uiState.selectedColorType ) + } }, onClickNavigateButton = viewModel::navigateToDetail, onClickScrapButton = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "modal_calender" + ) viewModel.postScrap(internshipAnnouncementId, uiState.selectedColorType) } ) } } - @Composable private fun ScrapDialogScreen( title: String, diff --git a/feature/src/main/java/com/terning/feature/filtering/filteringthree/FilteringThreeRoute.kt b/feature/src/main/java/com/terning/feature/filtering/filteringthree/FilteringThreeRoute.kt index 186610ddb..2fce106f9 100644 --- a/feature/src/main/java/com/terning/feature/filtering/filteringthree/FilteringThreeRoute.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filteringthree/FilteringThreeRoute.kt @@ -23,6 +23,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.button.RectangleButton import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.Grey300 @@ -49,6 +51,8 @@ fun FilteringThreeRoute( val context = LocalContext.current val lifecycleOwner = LocalLifecycleOwner.current + val amplitudeTracker = LocalTracker.current + LaunchedEffect(key1 = true) { with(viewModel) { updateGrade(grade = grade) @@ -78,7 +82,19 @@ fun FilteringThreeRoute( navigateUp = viewModel::navigateUp, chosenYear = Calendar.getInstance().currentYear, chosenMonth = Calendar.getInstance().currentMonth, - onNextClick = viewModel::postFilteringWithServer, + onNextClick = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "onboarding_completed", + properties = mapOf( + "grade" to state.grade, + "workingPeriod" to state.workingPeriod, + "startYear" to state.startYear, + "startMonth" to state.startMonth + ) + ) + viewModel.postFilteringWithServer() + }, onYearChosen = viewModel::updateStartYear, onMonthChosen = viewModel::updateStartMonth ) diff --git a/feature/src/main/java/com/terning/feature/home/HomeRoute.kt b/feature/src/main/java/com/terning/feature/home/HomeRoute.kt index 8962c8d57..bc88bac0d 100644 --- a/feature/src/main/java/com/terning/feature/home/HomeRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/HomeRoute.kt @@ -28,6 +28,8 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle import androidx.navigation.NavHostController import com.google.accompanist.systemuicontroller.rememberSystemUiController +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.bottomsheet.SortingBottomSheet import com.terning.core.designsystem.component.button.SortingButton import com.terning.core.designsystem.component.image.TerningImage @@ -80,6 +82,8 @@ fun HomeRoute( val lifecycleOwner = LocalLifecycleOwner.current val context = LocalContext.current + val amplitudeTracker = LocalTracker.current + LaunchedEffect(key1 = true) { viewModel.getProfile() viewModel.getFilteringInfo() @@ -97,8 +101,20 @@ fun HomeRoute( HomeScreen( paddingValues = paddingValues, - navigateToIntern = { navController.navigateIntern(announcementId = it) }, - navigateToCalendar = { navController.navigateCalendar() }, + navigateToIntern = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "home_intern_card" + ) + navController.navigateIntern(announcementId = it) + }, + navigateToCalendar = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "check_schedule" + ) + navController.navigateCalendar() + }, updateRecommendDialogVisibility = viewModel::updateRecommendDialogVisibility, updateUpcomingDialogVisibility = viewModel::updateUpcomingDialogVisibility, getHomeUpcomingInternList = viewModel::getHomeUpcomingInternList, @@ -143,15 +159,27 @@ fun HomeScreen( var changeFilteringSheetState by remember { mutableStateOf(false) } + val amplitudeTracker = LocalTracker.current + if (homeState.sortingSheetVisibility) { SortingBottomSheet( onDismiss = { viewModel.updateSortingSheetVisibility(false) }, currentSortBy = homeState.sortBy.ordinal, - onSortChange = { + onSortChange = { sortBy -> + amplitudeTracker.track( + type = EventType.CLICK, + name = when (sortBy) { + 0 -> "filtered_deadline" + 1 -> "filtered_short_term" + 2 -> "filtered_long_term" + 3 -> "filtered_scraps" + else -> "filtered_hits" + } + ) viewModel.updateSortBy( - it, + sortBy, homeFilteringInfo.startYear, homeFilteringInfo.startMonth, ) @@ -169,6 +197,10 @@ fun HomeScreen( defaultStartMonth = homeFilteringInfo.startMonth, onDismiss = { changeFilteringSheetState = false }, onChangeButtonClick = { grade, workingPeriod, year, month -> + amplitudeTracker.track( + type = EventType.CLICK, + name = "home_filtering_save" + ) viewModel.putFilteringInfo(grade, workingPeriod, year, month) changeFilteringSheetState = false } @@ -316,6 +348,10 @@ fun HomeScreen( navigateToIntern = navigateToIntern, intern = homeRecommendInternList[index], onScrapButtonClicked = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "home_scrap" + ) updateRecommendDialogVisibility(true) with(homeRecommendInternList[index]) { viewModel.updateHomeInternModel( diff --git a/feature/src/main/java/com/terning/feature/home/component/HomeFilteringScreen.kt b/feature/src/main/java/com/terning/feature/home/component/HomeFilteringScreen.kt index 532f3128c..992b9e5ee 100644 --- a/feature/src/main/java/com/terning/feature/home/component/HomeFilteringScreen.kt +++ b/feature/src/main/java/com/terning/feature/home/component/HomeFilteringScreen.kt @@ -22,6 +22,8 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.theme.Grey350 import com.terning.core.designsystem.theme.Grey400 import com.terning.core.designsystem.theme.TerningMain @@ -46,6 +48,8 @@ fun HomeFilteringScreen( horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically, ) { + val amplitudeTracker = LocalTracker.current + Row( modifier = Modifier .border( @@ -54,7 +58,13 @@ fun HomeFilteringScreen( shape = RoundedCornerShape(5.dp) ) .align(Alignment.CenterVertically) - .noRippleClickable(onChangeFilterClick), + .noRippleClickable { + amplitudeTracker.track( + type = EventType.CLICK, + name = "home_filtering" + ) + onChangeFilterClick() + }, ) { Icon( painter = painterResource(id = R.drawable.ic_home_filtering_28), diff --git a/feature/src/main/java/com/terning/feature/home/component/HomeUpcomingInternScreen.kt b/feature/src/main/java/com/terning/feature/home/component/HomeUpcomingInternScreen.kt index f94d242d4..954199340 100644 --- a/feature/src/main/java/com/terning/feature/home/component/HomeUpcomingInternScreen.kt +++ b/feature/src/main/java/com/terning/feature/home/component/HomeUpcomingInternScreen.kt @@ -32,6 +32,8 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import coil3.compose.AsyncImage import coil3.request.ImageRequest +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.item.ScrapBox import com.terning.core.designsystem.theme.Black import com.terning.core.designsystem.theme.Grey150 @@ -58,6 +60,8 @@ fun HomeUpcomingInternScreen( mutableStateOf(null) } + val amplitudeTracker = LocalTracker.current + LazyRow( horizontalArrangement = Arrangement.spacedBy(12.dp), contentPadding = PaddingValues(horizontal = 24.dp), @@ -82,6 +86,10 @@ fun HomeUpcomingInternScreen( modifier = Modifier .fillMaxHeight() .noRippleClickable { + amplitudeTracker.track( + type = EventType.CLICK, + name = "remind_intern_card" + ) selectedInternItem = homeUpcomingIntern updateUpcomingDialogVisibility(true) }, diff --git a/feature/src/main/java/com/terning/feature/intern/InternRoute.kt b/feature/src/main/java/com/terning/feature/intern/InternRoute.kt index 2f8e19db9..4ca709ba0 100644 --- a/feature/src/main/java/com/terning/feature/intern/InternRoute.kt +++ b/feature/src/main/java/com/terning/feature/intern/InternRoute.kt @@ -24,6 +24,8 @@ import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle import androidx.navigation.NavHostController +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.CalRed import com.terning.core.designsystem.theme.Grey200 @@ -54,6 +56,7 @@ fun InternRoute( val context = LocalContext.current val lifecycleOwner = LocalLifecycleOwner.current val internState by viewModel.internUiState.collectAsStateWithLifecycle(lifecycleOwner) + val amplitudeTracker = LocalTracker.current LaunchedEffect(key1 = true) { viewModel.getInternInfo(announcementId) @@ -94,6 +97,10 @@ fun InternRoute( viewModel.updateScrapCancelDialogVisibility(true) }, onClickScrapButton = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "detail_scrap" + ) viewModel.updateInternDialogVisibility(true) } ) diff --git a/feature/src/main/java/com/terning/feature/intern/component/InternBottomBar.kt b/feature/src/main/java/com/terning/feature/intern/component/InternBottomBar.kt index bf5b2f1bf..d61ee10a9 100644 --- a/feature/src/main/java/com/terning/feature/intern/component/InternBottomBar.kt +++ b/feature/src/main/java/com/terning/feature/intern/component/InternBottomBar.kt @@ -15,6 +15,8 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.button.RoundButton import com.terning.core.designsystem.theme.Grey150 import com.terning.core.designsystem.theme.Grey350 @@ -27,7 +29,6 @@ import com.terning.core.extension.noRippleClickable import com.terning.domain.entity.intern.InternInfo import com.terning.feature.R import com.terning.feature.intern.InternViewModel -import com.terning.feature.intern.model.InternUiState @Composable fun InternBottomBar( @@ -36,6 +37,8 @@ fun InternBottomBar( onScrapClick: (InternInfo) -> Unit, viewModel: InternViewModel = hiltViewModel(), ) { + val amplitudeTracker = LocalTracker.current + Row( modifier = modifier .fillMaxWidth() @@ -92,6 +95,10 @@ fun InternBottomBar( cornerRadius = 10.dp, text = R.string.intern_move_to_site, onButtonClick = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "detail_url" + ) viewModel.updateShowWeb(true) }, ) diff --git a/feature/src/main/java/com/terning/feature/main/MainScreen.kt b/feature/src/main/java/com/terning/feature/main/MainScreen.kt index 61714f0b6..3f83c0718 100644 --- a/feature/src/main/java/com/terning/feature/main/MainScreen.kt +++ b/feature/src/main/java/com/terning/feature/main/MainScreen.kt @@ -34,6 +34,8 @@ import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.navigation.compose.NavHost +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.snackbar.TerningBasicSnackBar import com.terning.core.designsystem.theme.Grey300 import com.terning.core.designsystem.theme.TerningMain @@ -55,6 +57,7 @@ import com.terning.feature.onboarding.splash.navigation.splashNavGraph import com.terning.feature.search.search.navigation.searchNavGraph import com.terning.feature.search.searchprocess.navigation.searchProcessNavGraph import kotlinx.coroutines.launch +import org.openjdk.tools.javac.Main @Composable fun MainScreen( @@ -67,6 +70,8 @@ fun MainScreen( val snackBarHostState = remember { SnackbarHostState() } val coroutineScope = rememberCoroutineScope() + val amplitudeTracker = LocalTracker.current + BackHandler(enabled = backPressedState) { if (System.currentTimeMillis() - backPressedTime <= 3000) { (context as Activity).finish() @@ -101,7 +106,18 @@ fun MainScreen( isVisible = navigator.showBottomBar(), tabs = MainTab.entries.toList(), currentTab = navigator.currentTab, - onTabSelected = navigator::navigate + onTabSelected = { navigation -> + amplitudeTracker.track( + type = EventType.CLICK, + name = when (navigation) { + MainTab.HOME -> "navigation_home" + MainTab.CALENDAR -> "navigation_calendar" + MainTab.SEARCH -> "navigation_search" + MainTab.MY_PAGE -> "navigation_mypage" + } + ) + navigator.navigate(navigation) + } ) }, ) { paddingValues -> diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt index ca7d283fb..69eb6be81 100644 --- a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt +++ b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt @@ -34,6 +34,8 @@ import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle import com.google.accompanist.systemuicontroller.rememberSystemUiController +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.bottomsheet.MyPageLogoutBottomSheet import com.terning.core.designsystem.component.bottomsheet.MyPageQuitBottomSheet import com.terning.core.designsystem.component.image.TerningImage @@ -69,6 +71,8 @@ fun MyPageRoute( val systemUiController = rememberSystemUiController() + val amplitudeTracker = LocalTracker.current + SideEffect { systemUiController.setStatusBarColor( color = Back @@ -114,6 +118,10 @@ fun MyPageRoute( MyPageLogoutBottomSheet( onDismiss = { viewModel.fetchShowLogoutBottomSheet(false) }, onLogoutClick = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "mypage_logout" + ) viewModel.logoutKakao() }, ) @@ -123,6 +131,10 @@ fun MyPageRoute( MyPageQuitBottomSheet( onDismiss = { viewModel.fetchShowQuitBottomSheet(false) }, onQuitClick = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "mypage_delete_account" + ) viewModel.quitKakao() } ) @@ -132,11 +144,29 @@ fun MyPageRoute( is UiState.Success -> { MyPageScreen( paddingValues = paddingValues, - onEditClick = viewModel::navigateToProfileEdit, + onEditClick = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "mypage_modify_profile" + ) + viewModel.navigateToProfileEdit() + }, onLogoutClick = { viewModel.fetchShowLogoutBottomSheet(true) }, onQuitClick = { viewModel.fetchShowQuitBottomSheet(true) }, - onNoticeClick = { viewModel.fetchShowNotice(true) }, - onOpinionClick = { viewModel.fetchShowOpinion(true) }, + onNoticeClick = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "mypage_notice" + ) + viewModel.fetchShowNotice(true) + }, + onOpinionClick = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "mypage_comment" + ) + viewModel.fetchShowOpinion(true) + }, onServiceClick = { viewModel.fetchShowService(true) }, onPersonalClick = { viewModel.fetchShowPersonal(true) }, name = state.name, diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt index c00b5cb96..ef6b52828 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt @@ -23,6 +23,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.bottomsheet.ProfileBottomSheet import com.terning.core.designsystem.component.button.RectangleButton import com.terning.core.designsystem.component.item.ProfileWithPlusButton @@ -47,6 +49,8 @@ fun SignUpRoute( val context = LocalContext.current val lifecycleOwner = LocalLifecycleOwner.current + val amplitudeTracker = LocalTracker.current + LaunchedEffect(key1 = true) { viewModel.updateAuthId(authId) } @@ -76,6 +80,10 @@ fun SignUpRoute( SignUpScreen( state = state, onSignUpClick = { + amplitudeTracker.track( + type = EventType.SIGNUP, + name = "kakao" + ) viewModel.postSignUpWithServer() }, onInputChange = { name -> 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 227ef863c..d95786be1 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()) diff --git a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt index c78994e39..2f87b1f03 100644 --- a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt @@ -33,6 +33,8 @@ import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle import androidx.navigation.NavHostController +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.bottomsheet.SortingBottomSheet import com.terning.core.designsystem.component.button.SortingButton import com.terning.core.designsystem.component.item.InternItemWithShadow @@ -168,6 +170,8 @@ fun SearchProcessScreen( val focusManager = LocalFocusManager.current val currentSortBy = remember { mutableIntStateOf(state.currentSortBy) } + val amplitudeTracker = LocalTracker.current + LaunchedEffect(Unit) { focusRequester.requestFocus() } @@ -267,6 +271,10 @@ fun SearchProcessScreen( intern = internSearchResultData[index], navigateToIntern = navigateToIntern, onScrapButtonClicked = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "quest_scrap" + ) with(internSearchResultData[index]) { onScrapButtonClicked(this) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 314d66512..a93f332be 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,8 +2,8 @@ compileSdk = "34" minSdk = "28" targetSdk = "34" -versionName = "1.1.5" -versionCode = "10105" +versionName = "1.1.6" +versionCode = "10106" kotlinCompilerExtensionVersion = "1.5.0" jvmTarget = "1.8"