-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Feature] GA4 클릭/스크롤 이벤트 추가 #245
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
5b2965d
Add Activity analytics event log function
ThirFir 1398d58
Add main page store click event analytics
ThirFir d06b6cb
Add StoreActivity category click event analytics
ThirFir 48eb8fd
Add Store click event analytics
ThirFir bd58a08
Add StoreDetail call click event analytics
ThirFir 6f8efda
Add StoreDetail picture click event analytics
ThirFir 506d28c
Create EventLogger, move activity logging logic to EventLogger
ThirFir bf0ff79
Add Hamburger click event analytics
ThirFir 9b2b890
Add MainActivity dining click event analytics
ThirFir a545e9f
Add dining time click/scroll event analytics
ThirFir 047afef
Add MainActivity bus card click event analytics
ThirFir 174b67d
Add MainActivity bus card scroll event analytics
ThirFir 661e3b4
Add BusMainFragment spinner click event analytics
ThirFir 3f61213
Add BusTimetableFragment click event analytics
ThirFir 05d14a7
Add Dining menu image click event analytics
ThirFir be3a4c8
Add Store search click event analytics, Modify get name logic
ThirFir 5389913
Add Sign up click event analytics
ThirFir dbfb841
Add Login click event analytics
ThirFir 501bf3c
Change store label
ThirFir 86341b2
Change description store -> shop
ThirFir ce63904
Use Reflection isInitialized
ThirFir 2ccb7a3
Change navi item analytics click event logic
ThirFir 88a12f9
Consider configuration change, use viewmodel
ThirFir 2fbe342
Set not to log if is debug
ThirFir 1251c4b
Remove unnecessary import
ThirFir da22668
Remove use of startActivty -> use callDrawerItem
ThirFir e91519e
Set untranslatable type description
ThirFir a04c386
Make parameters constant
ThirFir 824ae39
Remove unnecassary variable usage
ThirFir 2cc5f5b
Use StoreCategory.All
ThirFir be16867
Apply lint
ThirFir 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
48 changes: 48 additions & 0 deletions
48
core/src/main/java/in/koreatech/koin/core/analytics/EventLogger.kt
This file contains 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,48 @@ | ||
package `in`.koreatech.koin.core.analytics | ||
|
||
import com.google.firebase.analytics.ktx.analytics | ||
import com.google.firebase.analytics.ktx.logEvent | ||
import com.google.firebase.ktx.Firebase | ||
import `in`.koreatech.koin.core.BuildConfig | ||
import `in`.koreatech.koin.core.constant.AnalyticsConstant | ||
|
||
object EventLogger { | ||
|
||
private const val EVENT_CATEGORY = "event_category" | ||
private const val EVENT_LABEL = "event_label" | ||
private const val VALUE = "value" | ||
|
||
/** | ||
* @param action: 이벤트 발생 도메인(BUSINESS, CAMPUS, USER) | ||
* @param label: 이벤트 소분류 | ||
* @param value: 이벤트 값 | ||
*/ | ||
fun logClickEvent(action: String, label: String, value: String) { | ||
logEvent(action, AnalyticsConstant.Category.CLICK, label, value) | ||
} | ||
|
||
/** | ||
* @param action: 이벤트 발생 도메인(BUSINESS, CAMPUS, USER) | ||
* @param label: 이벤트 소분류 | ||
* @param value: 이벤트 값 | ||
*/ | ||
fun logScrollEvent(action: String, label: String, value: String) { | ||
logEvent(action, AnalyticsConstant.Category.SCROLL, label, value) | ||
} | ||
|
||
/** | ||
* @param action: 이벤트 발생 도메인(BUSINESS, CAMPUS, USER) | ||
* @param category: 이벤트 종류(click, scroll, ...) | ||
* @param label: 이벤트 소분류 | ||
* @param value: 이벤트 값 | ||
* @sample logEvent("BUSINESS", "click", "main_shop_categories", "전체보기") | ||
*/ | ||
private fun logEvent(action: String, category: String, label: String, value: String) { | ||
if (BuildConfig.IS_DEBUG) return | ||
Firebase.analytics.logEvent(action) { | ||
param(EVENT_CATEGORY, category) | ||
param(EVENT_LABEL, label) | ||
param(VALUE, value) | ||
} | ||
} | ||
} |
This file contains 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
48 changes: 48 additions & 0 deletions
48
core/src/main/java/in/koreatech/koin/core/constant/AnalyticsConstant.kt
This file contains 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,48 @@ | ||
package `in`.koreatech.koin.core.constant | ||
|
||
object AnalyticsConstant { | ||
|
||
object Domain { | ||
const val BUSINESS = "BUSINESS" | ||
const val CAMPUS = "CAMPUS" | ||
const val USER = "USER" | ||
} | ||
|
||
object Category { | ||
const val CLICK = "click" | ||
const val SCROLL = "scroll" | ||
} | ||
|
||
object Label { | ||
const val MAIN_SHOP_CATEGORIES = "main_shop_categories" | ||
const val SHOP_CATEGORIES = "shop_categories" | ||
const val SHOP_CATEGORIES_SEARCH = "shop_categories_search" | ||
const val HAMBURGER = "hamburger" | ||
const val HAMBURGER_SHOP = "${HAMBURGER}_shop" | ||
const val HAMBURGER_DINING = "${HAMBURGER}_dining" | ||
const val HAMBURGER_MY_INFO_WITHOUT_LOGIN = "${HAMBURGER}_my_info_without_login" | ||
const val HAMBURGER_MY_INFO_WITH_LOGIN = "${HAMBURGER}_my_info_with_login" | ||
const val HAMBURGER_BUS = "${HAMBURGER}_bus" | ||
const val USER_ONLY_OK = "user_only_ok" | ||
const val MAIN_MENU_MOVEDETAILVIEW = "main_menu_moveDetailView" | ||
const val MAIN_MENU_CORNER = "main_menu_corner" | ||
const val MENU_TIME = "menu_time" | ||
const val MAIN_BUS = "main_bus" | ||
const val MAIN_BUS_CHANGETOFROM = "main_bus_changeToFrom" | ||
const val MAIN_BUS_SCROLL = "main_bus_scroll" | ||
const val BUS_DEPARTURE = "bus_departure" | ||
const val BUS_ARRIVAL = "bus_arrival" | ||
const val BUS_TIMETABLE = "bus_timetable" | ||
const val BUS_TIMETABLE_AREA = "bus_timetable_area" | ||
const val BUS_TIMETABLE_TIME = "bus_timetable_time" | ||
const val BUS_TIMETABLE_EXPRESS = "bus_timetable_express" | ||
const val MENU_IMAGE = "menu_image" | ||
const val LOGIN = "login" | ||
const val START_SIGN_UP = "start_sign_up" | ||
const val COMPLETE_SIGN_UP = "complete_sign_up" | ||
const val SHOP_PICTURE = "shop_picture" | ||
const val SHOP_CALL = "shop_call" | ||
const val SHOP_CLICK = "shop_click" | ||
} | ||
|
||
} |
This file contains 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 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 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 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 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 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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
object in object 구조를 차용하는 이유가 있을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이벤트 로깅에 사용되는 상수임을 명확히 하기 위해 관련 상수들을 AnalyticsConstant라는 object 내에 배치하였고, 그 안에서도 각 상수들이 어떤 parameter에 쓰이는지 명확히 하기 위해 object로 다시 한 번 분류하였습니다.