Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT/#294] 엠플리튜드 이벤트 심기 #295

Merged
merged 22 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3e46a48
[FEAT/#294] 엠플리튜드 심기
leeeyubin Oct 21, 2024
8be46d2
[FEAT/#294] onboarding filtering amplitude
leeeyubin Oct 21, 2024
390ab58
[FEAT/#294] signup kakao amplitude
leeeyubin Oct 21, 2024
26fccfb
[FEAT/#294] mypage notice amplitude
leeeyubin Oct 21, 2024
d1477b6
[FEAT/#294] mypage comment amplitude
leeeyubin Oct 21, 2024
9bdf61b
[FEAT/#294] mypage modify amplitude
leeeyubin Oct 21, 2024
4d73b0c
[FEAT/#294] mypage logout and quit amplitude
leeeyubin Oct 21, 2024
9aca783
[FEAT/#294] navigation amplitude
leeeyubin Oct 21, 2024
65a1fff
[FEAT/#294] fix code
leeeyubin Oct 21, 2024
dbad766
[FEAT/#294] version update 1.1.5 -> 1.1.6
leeeyubin Oct 22, 2024
f46da5a
[FEAT/#294] search quest scrap amplitude
leeeyubin Oct 22, 2024
10f0f1f
[FEAT/#294] search quest search amplitude
leeeyubin Oct 22, 2024
82d31ce
[FEAT/#294] dialog color and scrap amplitude
leeeyubin Oct 22, 2024
ec63f97
[FEAT/#294] intern detail url amplitude
leeeyubin Oct 22, 2024
2ef1b9e
[FEAT/#294] dialog cancel amplitude
leeeyubin Oct 22, 2024
e46ad2d
[FEAT/#294] intern detail scrap amplitude
leeeyubin Oct 22, 2024
aff07ef
[FEAT/#294] git pull from develop
leeeyubin Oct 22, 2024
f787314
[FEAT/#294] calendar list amplitude
leeeyubin Oct 22, 2024
918454f
[FEAT/#294] home view amplitude
leeeyubin Oct 22, 2024
bb2010f
[FEAT/#294] home filtering amplitude
leeeyubin Oct 22, 2024
59df1b4
[FEAT/#294] home filtering save amplitude
leeeyubin Oct 22, 2024
941b149
[FEAT/#294] home remind card amplitude
leeeyubin Oct 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions core/src/main/java/com/terning/core/analytics/EventType.kt
Original file line number Diff line number Diff line change
@@ -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")
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -46,6 +48,8 @@ fun HomeFilteringScreen(
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically,
) {
val amplitudeTracker = LocalTracker.current

Row(
modifier = Modifier
.border(
Expand All @@ -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),
Expand Down
18 changes: 17 additions & 1 deletion feature/src/main/java/com/terning/feature/main/MainScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand All @@ -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()
Expand Down Expand Up @@ -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 ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -69,6 +71,8 @@ fun MyPageRoute(

val systemUiController = rememberSystemUiController()

val amplitudeTracker = LocalTracker.current

SideEffect {
systemUiController.setStatusBarColor(
color = Back
Expand Down Expand Up @@ -114,6 +118,10 @@ fun MyPageRoute(
MyPageLogoutBottomSheet(
onDismiss = { viewModel.fetchShowLogoutBottomSheet(false) },
onLogoutClick = {
amplitudeTracker.track(
type = EventType.CLICK,
name = "mypage_logout"
)
viewModel.logoutKakao()
},
)
Expand All @@ -123,6 +131,10 @@ fun MyPageRoute(
MyPageQuitBottomSheet(
onDismiss = { viewModel.fetchShowQuitBottomSheet(false) },
onQuitClick = {
amplitudeTracker.track(
type = EventType.CLICK,
name = "mypage_delete_account"
)
viewModel.quitKakao()
}
)
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -47,6 +49,8 @@ fun SignUpRoute(
val context = LocalContext.current
val lifecycleOwner = LocalLifecycleOwner.current

val amplitudeTracker = LocalTracker.current

LaunchedEffect(key1 = true) {
viewModel.updateAuthId(authId)
}
Expand Down Expand Up @@ -76,6 +80,10 @@ fun SignUpRoute(
SignUpScreen(
state = state,
onSignUpClick = {
amplitudeTracker.track(
type = EventType.SIGNUP,
name = "kakao"
)
viewModel.postSignUpWithServer()
},
onInputChange = { name ->
Expand Down
Loading