Sync analytics plan

This commit is contained in:
bmarty 2022-02-07 00:02:21 +00:00 committed by GitHub
parent ef3baee35b
commit 1369d1fa2f
8 changed files with 488 additions and 24 deletions

View File

@ -0,0 +1,53 @@
/*
* 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 sends a message via the composer.
*/
data class Composer(
/**
* Whether the user was using the composer inside of a thread.
*/
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 {
override fun getName() = "Composer"
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,172 @@
/*
* 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 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 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 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 interacted with leave action in the general tab of the room
* settings dialog in Element Web/Desktop.
*/
WebRoomSettingsLeaveButton,
}
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. * Whether the room is a DM.
*/ */
val isDM: Boolean, val isDM: Boolean,
/**
* Whether the room is a Space.
*/
val isSpace: Boolean,
/** /**
* The size of the room. * The size of the room.
*/ */
val roomSize: RoomSize, val roomSize: RoomSize,
/**
* The trigger for a room being joined if known.
*/
val trigger: Trigger? = null,
) : VectorAnalyticsEvent { ) : 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 { enum class RoomSize {
ElevenToOneHundred, ElevenToOneHundred,
MoreThanAThousand, MoreThanAThousand,
One,
OneHundredAndOneToAThousand, OneHundredAndOneToAThousand,
ThreeToTen, ThreeToTen,
Two, Two,
@ -48,7 +79,9 @@ data class JoinedRoom(
override fun getProperties(): Map<String, Any>? { override fun getProperties(): Map<String, Any>? {
return mutableMapOf<String, Any>().apply { return mutableMapOf<String, Any>().apply {
put("isDM", isDM) put("isDM", isDM)
put("isSpace", isSpace)
put("roomSize", roomSize.name) put("roomSize", roomSize.name)
trigger?.let { put("trigger", it.name) }
}.takeIf { it.isNotEmpty() } }.takeIf { it.isNotEmpty() }
} }
} }

View File

@ -83,13 +83,15 @@ data class PerformanceTimer(
StartupLaunchScreen, 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, StartupStorePreload,
/** /**
* The time to load all data from the store (including * 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, StartupStoreReady,
} }

View File

@ -121,6 +121,16 @@ data class Screen(
*/ */
MobileSidebar, MobileSidebar,
/**
* Screen that displays the list of memebrs 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. * The screen shown to select which room directory you'd like to use.
*/ */
@ -206,6 +216,11 @@ data class Screen(
*/ */
SettingsSecurity, SettingsSecurity,
/**
* Screen that displays the list of rooms and spaces of a space
*/
SpaceExploreRooms,
/** /**
* The screen shown to create a new direct room. * The screen shown to create a new direct room.
*/ */

View File

@ -22,29 +22,25 @@ import im.vector.app.features.analytics.itf.VectorAnalyticsEvent
// https://github.com/matrix-org/matrix-analytics-events/ // 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, val command: Command,
/**
* The unique name of this element.
*/
val name: Name,
) : VectorAnalyticsEvent { ) : VectorAnalyticsEvent {
enum class Name { enum class Command {
SendMessageButton, invite,
part,
} }
override fun getName() = "Click" override fun getName() = "SlashCommand"
override fun getProperties(): Map<String, Any>? { override fun getProperties(): Map<String, Any>? {
return mutableMapOf<String, Any>().apply { return mutableMapOf<String, Any>().apply {
index?.let { put("index", it) } put("command", command.name)
put("name", name.name)
}.takeIf { it.isNotEmpty() } }.takeIf { it.isNotEmpty() }
} }
} }

View File

@ -16,20 +16,23 @@
package im.vector.app.features.analytics.plan package im.vector.app.features.analytics.plan
import im.vector.app.features.analytics.itf.VectorAnalyticsEvent
// GENERATED FILE, DO NOT EDIT. FOR MORE INFORMATION VISIT // GENERATED FILE, DO NOT EDIT. FOR MORE INFORMATION VISIT
// https://github.com/matrix-org/matrix-analytics-events/ // https://github.com/matrix-org/matrix-analytics-events/
/** /**
* The user properties to apply when identifying * The user properties to apply when identifying. This is not an event
* definition. These properties must all be device independent.
*/ */
data class Identity( data class UserProperties(
/** /**
* The selected messaging use case during the onboarding flow. * The selected messaging use case during the onboarding flow.
*/ */
val ftueUseCaseSelection: FtueUseCaseSelection? = null, val ftueUseCaseSelection: FtueUseCaseSelection? = null,
) : VectorAnalyticsEvent { /**
* Number of spaces (and sub-spaces) the user is joined to
*/
val numSpaces: Int? = null,
) {
enum class FtueUseCaseSelection { enum class FtueUseCaseSelection {
/** /**
@ -53,11 +56,11 @@ data class Identity(
WorkMessaging, WorkMessaging,
} }
override fun getName() = "Identity"
override fun getProperties(): Map<String, Any?>? { fun getProperties(): Map<String, Any>? {
return mutableMapOf<String, Any?>().apply { return mutableMapOf<String, Any>().apply {
put("ftueUseCaseSelection", null) ftueUseCaseSelection?.let { put("ftueUseCaseSelection", it.name) }
numSpaces?.let { put("numSpaces", it) }
}.takeIf { it.isNotEmpty() } }.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() }
}
}