Merge pull request #5171 from vector-im/sync-analytics-plan

Sync analytics plan
This commit is contained in:
fedrunov 2022-02-10 15:47:32 +01:00 committed by GitHub
commit 00ada6748a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 731 additions and 88 deletions

View File

@ -18,7 +18,7 @@ package im.vector.app.features.analytics
import im.vector.app.features.analytics.itf.VectorAnalyticsEvent
import im.vector.app.features.analytics.itf.VectorAnalyticsScreen
import im.vector.app.features.analytics.plan.Identity
import im.vector.app.features.analytics.plan.UserProperties
interface AnalyticsTracker {
/**
@ -34,5 +34,5 @@ interface AnalyticsTracker {
/**
* Update user specific properties
*/
fun updateUserProperties(identity: Identity)
fun updateUserProperties(userProperties: UserProperties)
}

View File

@ -19,6 +19,7 @@ package im.vector.app.features.analytics.extensions
import im.vector.app.features.analytics.plan.JoinedRoom
import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.session.room.model.RoomSummary
import org.matrix.android.sdk.api.session.room.model.RoomType
import org.matrix.android.sdk.api.session.room.model.roomdirectory.PublicRoom
fun Int?.toAnalyticsRoomSize(): JoinedRoom.RoomSize {
@ -35,6 +36,7 @@ fun Int?.toAnalyticsRoomSize(): JoinedRoom.RoomSize {
fun RoomSummary?.toAnalyticsJoinedRoom(): JoinedRoom {
return JoinedRoom(
isDM = this?.isDirect.orFalse(),
isSpace = this?.roomType == RoomType.SPACE,
roomSize = this?.joinedMembersCount?.toAnalyticsRoomSize() ?: JoinedRoom.RoomSize.Two
)
}
@ -42,6 +44,7 @@ fun RoomSummary?.toAnalyticsJoinedRoom(): JoinedRoom {
fun PublicRoom.toAnalyticsJoinedRoom(): JoinedRoom {
return JoinedRoom(
isDM = false,
isSpace = false,
roomSize = numJoinedMembers.toAnalyticsRoomSize()
)
}

View File

@ -16,14 +16,14 @@
package im.vector.app.features.analytics.extensions
import im.vector.app.features.analytics.plan.Identity
import im.vector.app.features.analytics.plan.UserProperties
import im.vector.app.features.onboarding.FtueUseCase
fun FtueUseCase.toTrackingValue(): Identity.FtueUseCaseSelection {
fun FtueUseCase.toTrackingValue(): UserProperties.FtueUseCaseSelection {
return when (this) {
FtueUseCase.FRIENDS_FAMILY -> Identity.FtueUseCaseSelection.PersonalMessaging
FtueUseCase.TEAMS -> Identity.FtueUseCaseSelection.WorkMessaging
FtueUseCase.COMMUNITIES -> Identity.FtueUseCaseSelection.CommunityMessaging
FtueUseCase.SKIP -> Identity.FtueUseCaseSelection.Skip
FtueUseCase.FRIENDS_FAMILY -> UserProperties.FtueUseCaseSelection.PersonalMessaging
FtueUseCase.TEAMS -> UserProperties.FtueUseCaseSelection.WorkMessaging
FtueUseCase.COMMUNITIES -> UserProperties.FtueUseCaseSelection.CommunityMessaging
FtueUseCase.SKIP -> UserProperties.FtueUseCaseSelection.Skip
}
}

View File

@ -26,7 +26,7 @@ import im.vector.app.features.analytics.VectorAnalytics
import im.vector.app.features.analytics.itf.VectorAnalyticsEvent
import im.vector.app.features.analytics.itf.VectorAnalyticsScreen
import im.vector.app.features.analytics.log.analyticsTag
import im.vector.app.features.analytics.plan.Identity
import im.vector.app.features.analytics.plan.UserProperties
import im.vector.app.features.analytics.store.AnalyticsStore
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.flow.Flow
@ -175,8 +175,8 @@ class DefaultVectorAnalytics @Inject constructor(
?.screen(screen.getName(), screen.getProperties()?.toPostHogProperties())
}
override fun updateUserProperties(identity: Identity) {
posthog?.identify(REUSE_EXISTING_ID, identity.getProperties()?.toPostHogUserProperties(), IGNORED_OPTIONS)
override fun updateUserProperties(userProperties: UserProperties) {
posthog?.identify(REUSE_EXISTING_ID, userProperties.getProperties()?.toPostHogUserProperties(), IGNORED_OPTIONS)
}
private fun Map<String, Any?>?.toPostHogProperties(): Properties? {
@ -189,7 +189,7 @@ class DefaultVectorAnalytics @Inject constructor(
/**
* We avoid sending nulls as part of the UserProperties as this will reset the values across all devices
* The Identify event has nullable properties to allow for clients to opt in
* The UserProperties event has nullable properties to allow for clients to opt in
*/
private fun Map<String, Any?>.toPostHogUserProperties(): Properties {
return Properties().apply {

View File

@ -22,42 +22,32 @@ import im.vector.app.features.analytics.itf.VectorAnalyticsEvent
// https://github.com/matrix-org/matrix-analytics-events/
/**
* The user properties to apply when identifying
* Triggered when the user sends a message via the composer.
*/
data class Identity(
data class Composer(
/**
* The selected messaging use case during the onboarding flow.
* Whether the user was using the composer inside of a thread.
*/
val ftueUseCaseSelection: FtueUseCaseSelection? = null,
val inThread: Boolean,
/**
* Whether the user's composer interaction was editing a previously sent
* event.
*/
val isEditing: Boolean,
/**
* Whether the user's composer interaction was a reply to a previously
* sent event.
*/
val isReply: Boolean,
) : VectorAnalyticsEvent {
enum class FtueUseCaseSelection {
/**
* The third option, Communities.
*/
CommunityMessaging,
override fun getName() = "Composer"
/**
* The first option, Friends and family.
*/
PersonalMessaging,
/**
* The footer option to skip the question.
*/
Skip,
/**
* The second option, Teams.
*/
WorkMessaging,
}
override fun getName() = "Identity"
override fun getProperties(): Map<String, Any?>? {
return mutableMapOf<String, Any?>().apply {
put("ftueUseCaseSelection", ftueUseCaseSelection?.name)
override fun getProperties(): Map<String, Any>? {
return mutableMapOf<String, Any>().apply {
put("inThread", inThread)
put("isEditing", isEditing)
put("isReply", isReply)
}.takeIf { it.isNotEmpty() }
}
}

View File

@ -0,0 +1,250 @@
/*
* Copyright (c) 2021 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.app.features.analytics.plan
import im.vector.app.features.analytics.itf.VectorAnalyticsEvent
// GENERATED FILE, DO NOT EDIT. FOR MORE INFORMATION VISIT
// https://github.com/matrix-org/matrix-analytics-events/
/**
* Triggered when the user clicks/taps/activates a UI element.
*/
data class Interaction(
/**
* The index of the element, if its in a list of elements.
*/
val index: Int? = null,
/**
* The manner with which the user activated the UI element.
*/
val interactionType: InteractionType? = null,
/**
* The unique name of this element.
*/
val name: Name,
) : VectorAnalyticsEvent {
enum class Name {
/**
* User tapped the already selected space from the space list.
*/
SpacePanelSelectedSpace,
/**
* User tapped an unselected space from the space list -> space
* switching should occur.
*/
SpacePanelSwitchSpace,
/**
* User clicked the create room button in the + context menu of the room
* list header in Element Web/Desktop.
*/
WebAddExistingToSpaceDialogCreateRoomButton,
/**
* User clicked the create room button in the home page of Element
* Web/Desktop.
*/
WebHomeCreateRoomButton,
/**
* User interacted with pin to sidebar checkboxes in the quick settings
* menu of Element Web/Desktop.
*/
WebQuickSettingsPinToSidebarCheckbox,
/**
* User interacted with the theme dropdown in the quick settings menu of
* Element Web/Desktop.
*/
WebQuickSettingsThemeDropdown,
/**
* User accessed the room invite flow using the button at the top of the
* room member list in the right panel of Element Web/Desktop.
*/
WebRightPanelMemberListInviteButton,
/**
* User accessed room member list using the 'People' button in the right
* panel room summary card of Element Web/Desktop.
*/
WebRightPanelRoomInfoPeopleButton,
/**
* User accessed room settings using the 'Settings' button in the right
* panel room summary card of Element Web/Desktop.
*/
WebRightPanelRoomInfoSettingsButton,
/**
* User accessed room member list using the back button in the right
* panel user info card of Element Web/Desktop.
*/
WebRightPanelRoomUserInfoBackButton,
/**
* User invited someone to room by clicking invite on the right panel
* user info card in Element Web/Desktop.
*/
WebRightPanelRoomUserInfoInviteButton,
/**
* User clicked the create room button in the room directory of Element
* Web/Desktop.
*/
WebRoomDirectoryCreateRoomButton,
/**
* User adjusted their favourites using the context menu on the header
* of a room in Element Web/Desktop.
*/
WebRoomHeaderContextMenuFavouriteToggle,
/**
* User accessed the room invite flow using the context menu on the
* header of a room in Element Web/Desktop.
*/
WebRoomHeaderContextMenuInviteItem,
/**
* User interacted with leave action in the context menu on the header
* of a room in Element Web/Desktop.
*/
WebRoomHeaderContextMenuLeaveItem,
/**
* User accessed their room notification settings via the context menu
* on the header of a room in Element Web/Desktop.
*/
WebRoomHeaderContextMenuNotificationsItem,
/**
* User accessed room member list using the context menu on the header
* of a room in Element Web/Desktop.
*/
WebRoomHeaderContextMenuPeopleItem,
/**
* User accessed room settings using the context menu on the header of a
* room in Element Web/Desktop.
*/
WebRoomHeaderContextMenuSettingsItem,
/**
* User clicked the create room button in the + context menu of the room
* list header in Element Web/Desktop.
*/
WebRoomListHeaderPlusMenuCreateRoomItem,
/**
* User adjusted their favourites using the context menu on a room tile
* in the room list in Element Web/Desktop.
*/
WebRoomListRoomTileContextMenuFavouriteToggle,
/**
* User accessed the room invite flow using the context menu on a room
* tile in the room list in Element Web/Desktop.
*/
WebRoomListRoomTileContextMenuInviteItem,
/**
* User interacted with leave action in the context menu on a room tile
* in the room list in Element Web/Desktop.
*/
WebRoomListRoomTileContextMenuLeaveItem,
/**
* User accessed room settings using the context menu on a room tile in
* the room list in Element Web/Desktop.
*/
WebRoomListRoomTileContextMenuSettingsItem,
/**
* User accessed their room notification settings via the context menu
* on a room tile in the room list in Element Web/Desktop.
*/
WebRoomListRoomTileNotificationsMenu,
/**
* User clicked the create room button in the + context menu of the
* rooms sublist in Element Web/Desktop.
*/
WebRoomListRoomsSublistPlusMenuCreateRoomItem,
/**
* User interacted with leave action in the general tab of the room
* settings dialog in Element Web/Desktop.
*/
WebRoomSettingsLeaveButton,
/**
* User interacted with the prompt to create a new room when adjusting
* security settings in an existing room in Element Web/Desktop.
*/
WebRoomSettingsSecurityTabCreateNewRoomButton,
/**
* User interacted with the theme radio selector in the Appearance tab
* of Settings in Element Web/Desktop.
*/
WebSettingsAppearanceTabThemeSelector,
/**
* User interacted with the pre-built space checkboxes in the Sidebar
* tab of Settings in Element Web/Desktop.
*/
WebSettingsSidebarTabSpacesCheckbox,
/**
* User clicked the create room button in the + context menu of the room
* list header in Element Web/Desktop.
*/
WebSpaceContextMenuNewRoomItem,
/**
* User clicked the create room button in the + context menu of the room
* list header in Element Web/Desktop.
*/
WebSpaceHomeCreateRoomButton,
/**
* User clicked the theme toggle button in the user menu of Element
* Web/Desktop.
*/
WebUserMenuThemeToggleButton,
}
enum class InteractionType {
Keyboard,
Pointer,
Touch,
}
override fun getName() = "Interaction"
override fun getProperties(): Map<String, Any>? {
return mutableMapOf<String, Any>().apply {
index?.let { put("index", it) }
interactionType?.let { put("interactionType", it.name) }
put("name", name.name)
}.takeIf { it.isNotEmpty() }
}
}

View File

@ -29,15 +29,46 @@ data class JoinedRoom(
* Whether the room is a DM.
*/
val isDM: Boolean,
/**
* Whether the room is a Space.
*/
val isSpace: Boolean,
/**
* The size of the room.
*/
val roomSize: RoomSize,
/**
* The trigger for a room being joined if known.
*/
val trigger: Trigger? = null,
) : VectorAnalyticsEvent {
enum class Trigger {
/**
* Room joined via a push/desktop notification.
*/
Notification,
/**
* Room joined via the public rooms directory.
*/
RoomDirectory,
/**
* Room joined via the space hierarchy view.
*/
SpaceHierarchy,
/**
* Room joined via a timeline pill or link in another room.
*/
Timeline,
}
enum class RoomSize {
ElevenToOneHundred,
MoreThanAThousand,
One,
OneHundredAndOneToAThousand,
ThreeToTen,
Two,
@ -48,7 +79,9 @@ data class JoinedRoom(
override fun getProperties(): Map<String, Any>? {
return mutableMapOf<String, Any>().apply {
put("isDM", isDM)
put("isSpace", isSpace)
put("roomSize", roomSize.name)
trigger?.let { put("trigger", it.name) }
}.takeIf { it.isNotEmpty() }
}
}

View File

@ -83,13 +83,15 @@ data class PerformanceTimer(
StartupLaunchScreen,
/**
* The time to preload data in the MXStore on iOS.
* The time to preload data in the MXStore on iOS. In this case,
* `itemCount` should contain the number of rooms in the store.
*/
StartupStorePreload,
/**
* The time to load all data from the store (including
* StartupStorePreload time).
* StartupStorePreload time). In this case, `itemCount` should contain
* the number of rooms loaded into the session
*/
StartupStoreReady,
}

View File

@ -54,8 +54,8 @@ data class Screen(
Group,
/**
* The Home tab on iOS | possibly the same on Android? | The Home space
* on Web?
* The Home tab on iOS | possibly the same on Android? | Home page on
* Web
*/
Home,
@ -116,11 +116,41 @@ data class Screen(
*/
MobileSearchRooms,
/**
* The global settings screen shown in the app.
*/
MobileSettings,
/**
* The settings screen to change the default notification options.
*/
MobileSettingsDefaultNotifications,
/**
* The settings screen to manage notification mentions and keywords.
*/
MobileSettingsMentionsAndKeywords,
/**
* The global security settings screen.
*/
MobileSettingsSecurity,
/**
* The sidebar shown on mobile with spaces, settings etc.
*/
MobileSidebar,
/**
* Screen that displays the list of members of a space
*/
MobileSpaceMembers,
/**
* The bottom sheet that list all space options
*/
MobileSpaceMenu,
/**
* The screen shown to select which room directory you'd like to use.
*/
@ -187,24 +217,9 @@ data class Screen(
RoomUploads,
/**
* The global settings screen shown in the app.
* Screen that displays the list of rooms and spaces of a space
*/
Settings,
/**
* The settings screen to change the default notification options.
*/
SettingsDefaultNotifications,
/**
* The settings screen to manage notification mentions and keywords.
*/
SettingsMentionsAndKeywords,
/**
* The global security settings screen.
*/
SettingsSecurity,
SpaceExploreRooms,
/**
* The screen shown to create a new direct room.
@ -217,25 +232,91 @@ data class Screen(
User,
/**
* ?
* Element Web showing flow to trust this new device with cross-signing.
*/
WebCompleteSecurity,
/**
* ?
* Element Web showing flow to setup SSSS / cross-signing on this
* account.
*/
WebE2ESetup,
/**
* ?
* Element Web loading spinner.
*/
WebLoading,
/**
* ?
* Element Web device has been soft logged out by the server.
*/
WebSoftLogout,
/**
* Legacy: Element Web User Settings Flair Tab.
*/
WebUserSettingFlair,
/**
* Element Web User Settings Mjolnir (labs) Tab.
*/
WebUserSettingMjolnir,
/**
* Element Web User Settings Appearance Tab.
*/
WebUserSettingsAppearance,
/**
* Element Web User Settings General Tab.
*/
WebUserSettingsGeneral,
/**
* Element Web User Settings Help & About Tab.
*/
WebUserSettingsHelpAbout,
/**
* Element Web User Settings Ignored Users Tab.
*/
WebUserSettingsIgnoredUsers,
/**
* Element Web User Settings Keyboard Tab.
*/
WebUserSettingsKeyboard,
/**
* Element Web User Settings Labs Tab.
*/
WebUserSettingsLabs,
/**
* Element Web User Settings Notifications Tab.
*/
WebUserSettingsNotifications,
/**
* Element Web User Settings Preferences Tab.
*/
WebUserSettingsPreferences,
/**
* Element Web User Settings Security & Privacy Tab.
*/
WebUserSettingsSecurityPrivacy,
/**
* Element Web User Settings Sidebar Tab.
*/
WebUserSettingsSidebar,
/**
* Element Web User Settings Voice & Video Tab.
*/
WebUserSettingsVoiceVideo,
/**
* The splash screen.
*/

View File

@ -22,29 +22,25 @@ import im.vector.app.features.analytics.itf.VectorAnalyticsEvent
// https://github.com/matrix-org/matrix-analytics-events/
/**
* Triggered when the user clicks/taps on a UI element.
* Triggered when the user runs a slash command in their composer.
*/
data class Click(
data class SlashCommand(
/**
* The index of the element, if its in a list of elements.
* The name of this command.
*/
val index: Int? = null,
/**
* The unique name of this element.
*/
val name: Name,
val command: Command,
) : VectorAnalyticsEvent {
enum class Name {
SendMessageButton,
enum class Command {
Invite,
Part,
}
override fun getName() = "Click"
override fun getName() = "SlashCommand"
override fun getProperties(): Map<String, Any>? {
return mutableMapOf<String, Any>().apply {
index?.let { put("index", it) }
put("name", name.name)
put("command", command.name)
}.takeIf { it.isNotEmpty() }
}
}

View File

@ -0,0 +1,95 @@
/*
* Copyright (c) 2021 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.app.features.analytics.plan
// GENERATED FILE, DO NOT EDIT. FOR MORE INFORMATION VISIT
// https://github.com/matrix-org/matrix-analytics-events/
/**
* The user properties to apply when identifying. This is not an event
* definition. These properties must all be device independent.
*/
data class UserProperties(
/**
* Whether the user has the favourites space enabled
*/
val WebMetaSpaceFavouritesEnabled: Boolean? = null,
/**
* Whether the user has the home space set to all rooms
*/
val WebMetaSpaceHomeAllRooms: Boolean? = null,
/**
* Whether the user has the home space enabled
*/
val WebMetaSpaceHomeEnabled: Boolean? = null,
/**
* Whether the user has the other rooms space enabled
*/
val WebMetaSpaceOrphansEnabled: Boolean? = null,
/**
* Whether the user has the people space enabled
*/
val WebMetaSpacePeopleEnabled: Boolean? = null,
/**
* The selected messaging use case during the onboarding flow.
*/
val ftueUseCaseSelection: FtueUseCaseSelection? = null,
/**
* Number of joined rooms the user has favourited
*/
val numFavouriteRooms: Int? = null,
/**
* Number of spaces (and sub-spaces) the user is joined to
*/
val numSpaces: Int? = null,
) {
enum class FtueUseCaseSelection {
/**
* The third option, Communities.
*/
CommunityMessaging,
/**
* The first option, Friends and family.
*/
PersonalMessaging,
/**
* The footer option to skip the question.
*/
Skip,
/**
* The second option, Teams.
*/
WorkMessaging,
}
fun getProperties(): Map<String, Any>? {
return mutableMapOf<String, Any>().apply {
WebMetaSpaceFavouritesEnabled?.let { put("WebMetaSpaceFavouritesEnabled", it) }
WebMetaSpaceHomeAllRooms?.let { put("WebMetaSpaceHomeAllRooms", it) }
WebMetaSpaceHomeEnabled?.let { put("WebMetaSpaceHomeEnabled", it) }
WebMetaSpaceOrphansEnabled?.let { put("WebMetaSpaceOrphansEnabled", it) }
WebMetaSpacePeopleEnabled?.let { put("WebMetaSpacePeopleEnabled", it) }
ftueUseCaseSelection?.let { put("ftueUseCaseSelection", it.name) }
numFavouriteRooms?.let { put("numFavouriteRooms", it) }
numSpaces?.let { put("numSpaces", it) }
}.takeIf { it.isNotEmpty() }
}
}

View File

@ -0,0 +1,190 @@
/*
* Copyright (c) 2021 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.app.features.analytics.plan
import im.vector.app.features.analytics.itf.VectorAnalyticsEvent
// GENERATED FILE, DO NOT EDIT. FOR MORE INFORMATION VISIT
// https://github.com/matrix-org/matrix-analytics-events/
/**
* Triggered when the user changes rooms.
*/
data class ViewRoom(
/**
* The reason for the room change if known.
*/
val trigger: Trigger? = null,
/**
* Whether the interaction was performed via the keyboard input.
*/
val viaKeyboard: Boolean? = null,
) : VectorAnalyticsEvent {
enum class Trigger {
/**
* Room accessed due to being just created.
*/
Created,
/**
* Room switched due to user interacting with a message search result.
*/
MessageSearch,
/**
* Room switched due to user selecting a user to go to a DM with.
*/
MessageUser,
/**
* Room accessed via a push/desktop notification.
*/
Notification,
/**
* Room accessed via the predecessor link at the top of the upgraded
* room.
*/
Predecessor,
/**
* Room accessed via the public rooms directory.
*/
RoomDirectory,
/**
* Room accessed via the room list.
*/
RoomList,
/**
* Room accessed via a slash command in Element Web/Desktop like /goto.
*/
SlashCommand,
/**
* Room accessed via the space hierarchy view.
*/
SpaceHierarchy,
/**
* Room accessed via a timeline pill or link in another room.
*/
Timeline,
/**
* Room accessed via a tombstone at the bottom of a predecessor room.
*/
Tombstone,
/**
* Room switched due to user interacting with incoming verification
* request.
*/
VerificationRequest,
/**
* Room switched due to accepting a call in a different room in Element
* Web/Desktop.
*/
WebAcceptCall,
/**
* Room switched due to making a call via the dial pad in Element
* Web/Desktop.
*/
WebDialPad,
/**
* Room accessed via interacting with the floating call or Jitsi PIP in
* Element Web/Desktop.
*/
WebFloatingCallWindow,
/**
* Room accessed via the shortcut in Element Web/Desktop's forward
* modal.
*/
WebForwardShortcut,
/**
* Room accessed via the Element Web/Desktop horizontal breadcrumbs at
* the top of the room list.
*/
WebHorizontalBreadcrumbs,
/**
* Room accessed via an Element Web/Desktop keyboard shortcut like go to
* next room with unread messages.
*/
WebKeyboardShortcut,
/**
* Room accessed via Element Web/Desktop's notification panel.
*/
WebNotificationPanel,
/**
* Room accessed via the predecessor link in Settings > Advanced in
* Element Web/Desktop.
*/
WebPredecessorSettings,
/**
* Room accessed via clicking on a notifications badge on a room list
* sublist in Element Web/Desktop.
*/
WebRoomListNotificationBadge,
/**
* Room switched due to the user changing space in Element Web/Desktop.
*/
WebSpaceContextSwitch,
/**
* Room accessed via clicking on the notifications badge on the
* currently selected space in Element Web/Desktop.
*/
WebSpacePanelNotificationBadge,
/**
* Room accessed via Element Web/Desktop's Unified Search modal.
*/
WebUnifiedSearch,
/**
* Room accessed via the Element Web/Desktop vertical breadcrumb hover
* menu.
*/
WebVerticalBreadcrumbs,
/**
* Room switched due to widget interaction.
*/
Widget,
}
override fun getName() = "ViewRoom"
override fun getProperties(): Map<String, Any>? {
return mutableMapOf<String, Any>().apply {
trigger?.let { put("trigger", it.name) }
viaKeyboard?.let { put("viaKeyboard", it) }
}.takeIf { it.isNotEmpty() }
}
}

View File

@ -119,7 +119,7 @@ import im.vector.app.core.utils.startInstallFromSourceIntent
import im.vector.app.core.utils.toast
import im.vector.app.databinding.DialogReportContentBinding
import im.vector.app.databinding.FragmentTimelineBinding
import im.vector.app.features.analytics.plan.Click
import im.vector.app.features.analytics.plan.Composer
import im.vector.app.features.analytics.plan.Screen
import im.vector.app.features.attachments.AttachmentTypeSelectorView
import im.vector.app.features.attachments.AttachmentsHelper
@ -1499,7 +1499,9 @@ class TimelineFragment @Inject constructor(
return
}
if (text.isNotBlank()) {
analyticsTracker.capture(Click(name = Click.Name.SendMessageButton))
withState(messageComposerViewModel) { state ->
analyticsTracker.capture(Composer(isThreadTimeLine(), isEditing = state.sendMode is SendMode.Edit, isReply = state.sendMode is SendMode.Reply))
}
// We collapse ASAP, if not there will be a slight annoying delay
views.composerLayout.collapse(true)
lockSendButton = true

View File

@ -39,7 +39,7 @@ import im.vector.app.core.utils.ensureTrailingSlash
import im.vector.app.features.VectorFeatures
import im.vector.app.features.analytics.AnalyticsTracker
import im.vector.app.features.analytics.extensions.toTrackingValue
import im.vector.app.features.analytics.plan.Identity
import im.vector.app.features.analytics.plan.UserProperties
import im.vector.app.features.login.HomeServerConnectionConfigFactory
import im.vector.app.features.login.LoginConfig
import im.vector.app.features.login.LoginMode
@ -752,7 +752,7 @@ class OnboardingViewModel @AssistedInject constructor(
private suspend fun onSessionCreated(session: Session) {
awaitState().useCase?.let { useCase ->
session.vectorStore(applicationContext).setUseCase(useCase)
analyticsTracker.updateUserProperties(Identity(ftueUseCaseSelection = useCase.toTrackingValue()))
analyticsTracker.updateUserProperties(UserProperties(ftueUseCaseSelection = useCase.toTrackingValue()))
}
activeSessionHolder.setActiveSession(session)

View File

@ -251,6 +251,7 @@ class RoomPreviewViewModel @AssistedInject constructor(
analyticsTracker.capture(JoinedRoom(
// Always false in this case (?)
isDM = false,
isSpace = false,
roomSize = state.numJoinMembers.toAnalyticsRoomSize()
))
// We do not update the joiningRoomsIds here, because, the room is not joined yet regarding the sync data.

View File

@ -29,7 +29,7 @@ class VectorSettingsRootFragment @Inject constructor() : VectorSettingsBaseFragm
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
analyticsScreenName = Screen.ScreenName.Settings
analyticsScreenName = Screen.ScreenName.MobileSettings
}
override fun bindPref() {

View File

@ -94,7 +94,7 @@ class VectorSettingsSecurityPrivacyFragment @Inject constructor(
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
analyticsScreenName = Screen.ScreenName.SettingsSecurity
analyticsScreenName = Screen.ScreenName.MobileSettingsSecurity
}
// cryptography

View File

@ -38,7 +38,7 @@ class VectorSettingsDefaultNotificationPreferenceFragment :
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
analyticsScreenName = Screen.ScreenName.SettingsDefaultNotifications
analyticsScreenName = Screen.ScreenName.MobileSettingsDefaultNotifications
}
override fun bindPref() {

View File

@ -45,7 +45,7 @@ class VectorSettingsKeywordAndMentionsNotificationPreferenceFragment :
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
analyticsScreenName = Screen.ScreenName.SettingsMentionsAndKeywords
analyticsScreenName = Screen.ScreenName.MobileSettingsMentionsAndKeywords
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {