Skip to content

Commit

Permalink
feat: send basic segmentations with all events
Browse files Browse the repository at this point in the history
  • Loading branch information
ohassine committed Jan 24, 2025
1 parent 6c78e8c commit 14fb43b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,7 @@ class HomeViewModel @Inject constructor(
fun sendOpenProfileEvent() {
analyticsManager.sendEvent(
AnalyticsEvent.UserProfileOpened(
isMigrationDotActive = homeState.shouldShowCreateTeamUnreadIndicator,
appVersion = BuildConfig.VERSION_NAME,
deviceModel = Build.MODEL,
osVersion = Build.VERSION.RELEASE
isMigrationDotActive = homeState.shouldShowCreateTeamUnreadIndicator
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
*/
package com.wire.android.ui.home

import android.os.Build
import androidx.lifecycle.SavedStateHandle
import com.wire.android.BuildConfig
import com.wire.android.config.CoroutineTestExtension
import com.wire.android.datastore.GlobalDataStore
import com.wire.android.datastore.UserDataStore
Expand Down Expand Up @@ -110,10 +108,7 @@ class HomeViewModelTest {
verify(exactly = 1) {
arrangement.analyticsManager.sendEvent(
AnalyticsEvent.UserProfileOpened(
isMigrationDotActive = viewModel.homeState.shouldShowCreateTeamUnreadIndicator,
appVersion = BuildConfig.VERSION_NAME,
deviceModel = Build.MODEL,
osVersion = Build.VERSION.RELEASE
isMigrationDotActive = viewModel.homeState.shouldShowCreateTeamUnreadIndicator
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@
*/
package com.wire.android.feature.analytics

class AnonymousAnalyticsRecorderImpl : AnonymousAnalyticsRecorderStub()
class AnonymousAnalyticsRecorderImpl(
private val appVersion: String,
private val appName: String
) : AnonymousAnalyticsRecorderStub()
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
package com.wire.android.feature.analytics.model

import com.wire.android.feature.analytics.model.AnalyticsEventConstants.APP_VERSION
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.CALLING_ENDED
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.CALLING_ENDED_AV_SWITCH_TOGGLE
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.CALLING_ENDED_CALL_DIRECTION
Expand All @@ -44,15 +43,13 @@ import com.wire.android.feature.analytics.model.AnalyticsEventConstants.CLICKED_
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.CLICKED_DISMISS_CTA
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.CLICKED_PERSONAL_MIGRATION_CTA_EVENT
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.CONTRIBUTED_LOCATION
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.DEVICE_MODEL
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.MESSAGE_ACTION_KEY
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.MIGRATION_DOT_ACTIVE
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.MODAL_BACK_TO_WIRE_CLICKED
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.MODAL_CONTINUE_CLICKED
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.MODAL_LEAVE_CLICKED
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.MODAL_OPEN_TEAM_MANAGEMENT_CLICKED
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.MODAL_TEAM_NAME
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.OS_VERSION
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.PERSONAL_TEAM_CREATION_FLOW_CANCELLED
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.PERSONAL_TEAM_CREATION_FLOW_COMPLETED
import com.wire.android.feature.analytics.model.AnalyticsEventConstants.PERSONAL_TEAM_CREATION_FLOW_STARTED_EVENT
Expand Down Expand Up @@ -298,19 +295,13 @@ interface AnalyticsEvent {
}

data class UserProfileOpened(
val isMigrationDotActive: Boolean,
val appVersion: String,
val deviceModel: String,
val osVersion: String
val isMigrationDotActive: Boolean
) : AnalyticsEvent {
override val key: String = USER_PROFILE_OPENED

override fun toSegmentation(): Map<String, Any> {
return mapOf(
MIGRATION_DOT_ACTIVE to isMigrationDotActive,
APP_VERSION to appVersion,
OS_VERSION to osVersion,
DEVICE_MODEL to deviceModel
MIGRATION_DOT_ACTIVE to isMigrationDotActive
)
}
}
Expand Down

0 comments on commit 14fb43b

Please sign in to comment.