Repository navigation
[FEAT/#131] 앰플리튜드 세팅 #133
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
Merged
Merged
[FEAT/#131] 앰플리튜드 세팅 #133
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
eeb2e37
[feat/#131] 앰플리튜드 sdk 추가
vahkjsdf d4b893c
[feat/#131] 오프라인 상태 권한 추가
vahkjsdf 020a562
[feat/#131] 앰플리튜드 인스턴스 생성 및 초기화
vahkjsdf 882ecb4
[feat/#131] 카카오 로그인, 회원가입 - userId 추가
vahkjsdf 2b6926a
[chore/#131] AmplitudeModule 패키지 이동(amplitude)
vahkjsdf 004e776
[feat/#131] event 트래킹 인터페이스 및 앰플리튜드 구현체 추가
vahkjsdf e470d06
[feat/#131] 화면 조회 이벤트 트래킹
vahkjsdf 6021307
[feat/#131] 로그인, 회원가입 시 앰플리튜드 userId 설정
vahkjsdf 1f98074
[feat/#131] 로그아웃/탈퇴/세션 만료 시 앰플리튜드 초기화
vahkjsdf 9115676
[feat/#131] 회원가입 완료 이벤트 트래킹
vahkjsdf 0f93a2c
[feat/#131] 모임 생성 단계 조회 이벤트 트래킹
vahkjsdf 1deabf6
[feat/#131] 모임 생성 완료 이벤트 트래킹
vahkjsdf 7438e9e
[feat/#131] 초대 링크 공유 이벤트 트래킹
vahkjsdf eda4f87
[feat/#131] 모임 참여 이벤트 트래킹
vahkjsdf 9659980
[feat/#131] 조건 입력 단계 조회 이벤트 트래킹
vahkjsdf 68901df
[feat/#131] 조건 제출 이벤트 트래킹
vahkjsdf 65be841
[feat/#131] 추천 지역 선택 이벤트 트래킹
vahkjsdf 4b9727c
[feat/#131] 장소 상세 조회·길찾기 이벤트 트래킹
vahkjsdf 745c3ba
[feat/#131] 장소 투표 제출 이벤트 트래킹
vahkjsdf 1182e09
[feat/#131] 푸시 알림 오픈 이벤트 트래킹
vahkjsdf ad9c985
[fix/#131] 프로세스 복원 시 화면 조회 이벤트 누락 수정
vahkjsdf 3719005
[refactor/#131] 초대 링크 공유 이벤트명을 Share Clicked로 변경
vahkjsdf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
app/src/main/java/com/moive/app/core/analytics/AnalyticsModule.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package com.moive.app.core.analytics | ||
|
|
||
| import com.moive.app.core.analytics.amplitude.AmplitudeTracker | ||
| import dagger.Binds | ||
| import dagger.Module | ||
| import dagger.hilt.InstallIn | ||
| import dagger.hilt.components.SingletonComponent | ||
| import javax.inject.Singleton | ||
|
|
||
| @Module | ||
| @InstallIn(SingletonComponent::class) | ||
| abstract class AnalyticsModule { | ||
|
|
||
| @Binds | ||
| @Singleton | ||
| abstract fun bindAnalyticsTracker( | ||
| analyticsTracker: AmplitudeTracker | ||
| ): AnalyticsTracker | ||
| } |
11 changes: 11 additions & 0 deletions
11
app/src/main/java/com/moive/app/core/analytics/AnalyticsTracker.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package com.moive.app.core.analytics | ||
|
|
||
| import com.moive.app.core.analytics.event.AnalyticsEvent | ||
|
|
||
| interface AnalyticsTracker { | ||
| fun track(event: AnalyticsEvent) | ||
|
|
||
| fun setUserId(userId: Long) | ||
|
|
||
| fun reset() | ||
| } |
32 changes: 32 additions & 0 deletions
32
app/src/main/java/com/moive/app/core/analytics/amplitude/AmplitudeModule.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package com.moive.app.core.analytics.amplitude | ||
|
|
||
| import android.content.Context | ||
| import com.amplitude.android.Amplitude | ||
| import com.amplitude.android.autocaptureOptions | ||
| import com.moive.app.BuildConfig | ||
| import dagger.Module | ||
| import dagger.Provides | ||
| import dagger.hilt.InstallIn | ||
| import dagger.hilt.android.qualifiers.ApplicationContext | ||
| import dagger.hilt.components.SingletonComponent | ||
| import javax.inject.Singleton | ||
|
|
||
| @Module | ||
| @InstallIn(SingletonComponent::class) | ||
| object AmplitudeModule { | ||
|
|
||
| @Provides | ||
| @Singleton | ||
| fun provideAmplitude( | ||
| @ApplicationContext context: Context, | ||
| ): Amplitude = Amplitude( | ||
| apiKey = BuildConfig.AMPLITUDE_API_KEY, | ||
| context = context | ||
| ) { | ||
| minIdLength = 1 | ||
| autocapture = autocaptureOptions { | ||
| +sessions | ||
| +appLifecycles | ||
| } | ||
| } | ||
| } |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/com/moive/app/core/analytics/amplitude/AmplitudeTracker.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| package com.moive.app.core.analytics.amplitude | ||
|
|
||
| import com.amplitude.android.Amplitude | ||
| import com.moive.app.core.analytics.AnalyticsTracker | ||
| import com.moive.app.core.analytics.event.AnalyticsEvent | ||
| import javax.inject.Inject | ||
|
|
||
| class AmplitudeTracker @Inject constructor( | ||
| private val amplitude: Amplitude, | ||
| ) : AnalyticsTracker { | ||
|
|
||
| override fun track(event: AnalyticsEvent) { | ||
| amplitude.track(event.name, event.properties) | ||
| } | ||
|
|
||
| override fun setUserId(userId: Long) { | ||
| amplitude.setUserId(userId.toString()) | ||
| } | ||
|
|
||
| override fun reset() { | ||
| amplitude.reset() | ||
| } | ||
| } |
153 changes: 153 additions & 0 deletions
153
app/src/main/java/com/moive/app/core/analytics/event/AnalyticsEvent.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| package com.moive.app.core.analytics.event | ||
|
|
||
| sealed interface AnalyticsEvent { | ||
| val name: String | ||
| val properties: Map<String, Any?> | ||
| get() = emptyMap() | ||
|
|
||
| data class ScreenViewed( | ||
| val screenName: String, | ||
| val meetingId: Long? = null, | ||
| ) : AnalyticsEvent { | ||
| override val name = "Screen Viewed" | ||
| override val properties: Map<String, Any?> | ||
| get() = buildMap { | ||
| put(AnalyticsPropertyKey.SCREEN_NAME, screenName) | ||
| meetingId?.let { put(AnalyticsPropertyKey.MEETING_ID, it) } | ||
| } | ||
| } | ||
|
|
||
| // 가입 | ||
| data object SignUpCompleted : AnalyticsEvent { | ||
| override val name = "Sign Up Completed" | ||
| } | ||
|
|
||
| // 모임 생성 | ||
| data class MeetingCreationStepViewed( | ||
| val step: String, | ||
| ) : AnalyticsEvent { | ||
| override val name = "Meeting Creation Step Viewed" | ||
| override val properties: Map<String, Any?> | ||
| get() = mapOf(AnalyticsPropertyKey.STEP to step) | ||
| } | ||
|
|
||
| data class MeetingCreated( | ||
| val meetingId: Long, | ||
| val purpose: String, | ||
| val hasSchedule: Boolean, | ||
| ) : AnalyticsEvent { | ||
| override val name = "Meeting Created" | ||
| override val properties: Map<String, Any?> | ||
| get() = mapOf( | ||
| AnalyticsPropertyKey.MEETING_ID to meetingId, | ||
| AnalyticsPropertyKey.PURPOSE to purpose, | ||
| AnalyticsPropertyKey.HAS_SCHEDULE to hasSchedule, | ||
| ) | ||
| } | ||
|
|
||
| // 초대 | ||
| // 공유 선택창 실행 시점 (실제 공유 완료 여부는 알 수 없음) | ||
| data class InviteLinkShareClicked( | ||
| val meetingId: Long, | ||
| val source: Source, | ||
| ) : AnalyticsEvent { | ||
| override val name = "Invite Link Share Clicked" | ||
| override val properties: Map<String, Any?> | ||
| get() = mapOf( | ||
| AnalyticsPropertyKey.MEETING_ID to meetingId, | ||
| AnalyticsPropertyKey.SOURCE to source.value, | ||
| ) | ||
|
|
||
| enum class Source(val value: String) { | ||
| DETAIL("detail"), | ||
| CONFIRMED("confirmed"), | ||
| } | ||
| } | ||
|
|
||
| data class MeetingJoined( | ||
| val meetingId: Long, | ||
| ) : AnalyticsEvent { | ||
| override val name = "Meeting Joined" | ||
| override val properties: Map<String, Any?> | ||
| get() = mapOf(AnalyticsPropertyKey.MEETING_ID to meetingId) | ||
| } | ||
|
|
||
| // 조건 입력 | ||
| data class ConditionStepViewed( | ||
| val meetingId: Long, | ||
| val step: String, | ||
| ) : AnalyticsEvent { | ||
| override val name = "Condition Step Viewed" | ||
| override val properties: Map<String, Any?> | ||
| get() = mapOf( | ||
| AnalyticsPropertyKey.MEETING_ID to meetingId, | ||
| AnalyticsPropertyKey.STEP to step, | ||
| ) | ||
| } | ||
|
|
||
| data class ConditionSubmitted( | ||
| val meetingId: Long, | ||
| ) : AnalyticsEvent { | ||
| override val name = "Condition Submitted" | ||
| override val properties: Map<String, Any?> | ||
| get() = mapOf(AnalyticsPropertyKey.MEETING_ID to meetingId) | ||
| } | ||
|
|
||
| // 장소 투표 | ||
| data class RecommendedAreaSelected( | ||
| val meetingId: Long, | ||
| ) : AnalyticsEvent { | ||
| override val name = "Recommended Area Selected" | ||
| override val properties: Map<String, Any?> | ||
| get() = mapOf(AnalyticsPropertyKey.MEETING_ID to meetingId) | ||
| } | ||
|
|
||
| data class PlaceDetailViewed( | ||
| val meetingId: Long, | ||
| val placeId: Long, | ||
| ) : AnalyticsEvent { | ||
| override val name = "Place Detail Viewed" | ||
| override val properties: Map<String, Any?> | ||
| get() = mapOf( | ||
| AnalyticsPropertyKey.MEETING_ID to meetingId, | ||
| AnalyticsPropertyKey.PLACE_ID to placeId, | ||
| ) | ||
| } | ||
|
|
||
| data class PlaceRouteOpened( | ||
| val meetingId: Long, | ||
| val placeId: Long, | ||
| ) : AnalyticsEvent { | ||
| override val name = "Place Route Opened" | ||
| override val properties: Map<String, Any?> | ||
| get() = mapOf( | ||
| AnalyticsPropertyKey.MEETING_ID to meetingId, | ||
| AnalyticsPropertyKey.PLACE_ID to placeId, | ||
| ) | ||
| } | ||
|
|
||
| // 알림 | ||
| data class PushNotificationOpened( | ||
| val notificationId: Long?, | ||
| val meetingId: Long?, | ||
| ) : AnalyticsEvent { | ||
| override val name = "Push Notification Opened" | ||
| override val properties: Map<String, Any?> | ||
| get() = buildMap { | ||
| notificationId?.let { put(AnalyticsPropertyKey.NOTIFICATION_ID, it) } | ||
| meetingId?.let { put(AnalyticsPropertyKey.MEETING_ID, it) } | ||
| } | ||
| } | ||
|
|
||
| data class PlaceVoteSubmitted( | ||
| val meetingId: Long, | ||
| val selectedCount: Int, | ||
| ) : AnalyticsEvent { | ||
| override val name = "Place Vote Submitted" | ||
| override val properties: Map<String, Any?> | ||
| get() = mapOf( | ||
| AnalyticsPropertyKey.MEETING_ID to meetingId, | ||
| AnalyticsPropertyKey.SELECTED_COUNT to selectedCount, | ||
| ) | ||
| } | ||
| } |
24 changes: 24 additions & 0 deletions
24
app/src/main/java/com/moive/app/core/analytics/event/AnalyticsPropertyKey.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| package com.moive.app.core.analytics.event | ||
|
|
||
| object AnalyticsPropertyKey { | ||
| // 공통 | ||
| const val SCREEN_NAME = "screen_name" | ||
| const val MEETING_ID = "meeting_id" | ||
|
|
||
| // 모임 생성 | ||
| const val PURPOSE = "purpose" | ||
| const val HAS_SCHEDULE = "has_schedule" | ||
|
|
||
| // 초대 | ||
| const val SOURCE = "source" | ||
|
|
||
| // 단계 | ||
| const val STEP = "step" | ||
|
|
||
| // 장소 / 투표 | ||
| const val PLACE_ID = "place_id" | ||
| const val SELECTED_COUNT = "selected_count" | ||
|
|
||
| // 알림 | ||
| const val NOTIFICATION_ID = "notification_id" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.