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

DEP-338 feat: mixpanel event 붙이기 #171

Merged
merged 5 commits into from
Jan 7, 2023
Merged

Conversation

kimhyeing
Copy link
Contributor

@kimhyeing kimhyeing commented Jan 7, 2023

💁‍♂️ 변경 내용

AS-IS

TO-BE

  • 분석 툴을 위한 util을 제작했습니다
  • 짝궁화면 제외 믹스패널을 다 연결했습니다

📢 전달사항

사용법
name : EventName
properties엔 ScreenName이랑 ButtonType 두가지가 있는데, 화면을 보기만 하는 이벤트들은 ButtonType이 필요없습니다.

ScreenName 설정 방법

  1. getScreenName
  2. Screen.~~~ (ThreeDaysEvent.kt -> Screen enum class에서 가져오기)

ButtonType 설정 방법

  1. ButtonType.~~~ (ThreeDaysEvent.kt -> ButtonType enum class에서 가져오기)

name 설정 방법 (이벤트네임)

  1. getViewedEventName
  2. ThreeDaysEvent.~~~ (ThreeDaysEvent.kt -> ThreeDaysEvent enum class에서 가져오기)

getViewedEventName(context: Context) -> 클래스 명이 SignupActivity 이면 SignupViewed 로 리턴해줍니다
getScreenName(context: Context) -> 클래스 명이 SignupActivity 이면 Signup 으로 리턴해줍니다

AnalyticsUtil.event(
            name = getViewedEventName(this),
            properties = mapOf(
                MixPanelEvent.ScreenName to getScreenName(this)
            )
        )
AnalyticsUtil.event(
                name = ThreeDaysEvent.ButtonClicked.toString(),
                properties = mapOf(
                    MixPanelEvent.ScreenName to getScreenName(this),
                    MixPanelEvent.ButtonType to ButtonType.Next.toString()
                )
            )

주의사항 : enum class에서 값을 가져오는 경우 toString() 함수를 호출해서 string으로 변경해줘야합니다

@kimhyeing kimhyeing self-assigned this Jan 7, 2023
@kimhyeing kimhyeing requested a review from a team as a code owner January 7, 2023 08:42
@juhwankim-dev juhwankim-dev merged commit 2b976b0 into develop Jan 7, 2023
@juhwankim-dev juhwankim-dev deleted the feature/DEP-338 branch January 7, 2023 14:24
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.4% 0.4% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants