Add opt-in analytics to onboarding tasks (#8409)
* Add interaction tracking to explore room, send DM and create room events in onboarding view and elsewhere * Update matrix analytics events dependencypull/28788/head^2
parent
c7c0fdbcc5
commit
9b0ab3321c
|
@ -88,7 +88,7 @@
|
||||||
"linkifyjs": "^4.0.0-beta.4",
|
"linkifyjs": "^4.0.0-beta.4",
|
||||||
"lodash": "^4.17.20",
|
"lodash": "^4.17.20",
|
||||||
"maplibre-gl": "^1.15.2",
|
"maplibre-gl": "^1.15.2",
|
||||||
"matrix-analytics-events": "github:matrix-org/matrix-analytics-events.git#daad3faed54f0b1f1e026a7498b4653e4d01cd90",
|
"matrix-analytics-events": "github:matrix-org/matrix-analytics-events.git#4aef17b56798639906f26a8739043a3c5c5fde7e",
|
||||||
"matrix-encrypt-attachment": "^1.0.3",
|
"matrix-encrypt-attachment": "^1.0.3",
|
||||||
"matrix-events-sdk": "^0.0.1-beta.7",
|
"matrix-events-sdk": "^0.0.1-beta.7",
|
||||||
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop",
|
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop",
|
||||||
|
|
|
@ -34,13 +34,15 @@ import Analytics from "../../Analytics";
|
||||||
import PosthogTrackers from "../../PosthogTrackers";
|
import PosthogTrackers from "../../PosthogTrackers";
|
||||||
import EmbeddedPage from "./EmbeddedPage";
|
import EmbeddedPage from "./EmbeddedPage";
|
||||||
|
|
||||||
const onClickSendDm = () => {
|
const onClickSendDm = (ev: ButtonEvent) => {
|
||||||
Analytics.trackEvent('home_page', 'button', 'dm');
|
Analytics.trackEvent('home_page', 'button', 'dm');
|
||||||
|
PosthogTrackers.trackInteraction("WebHomeCreateChatButton", ev);
|
||||||
dis.dispatch({ action: 'view_create_chat' });
|
dis.dispatch({ action: 'view_create_chat' });
|
||||||
};
|
};
|
||||||
|
|
||||||
const onClickExplore = () => {
|
const onClickExplore = (ev: ButtonEvent) => {
|
||||||
Analytics.trackEvent('home_page', 'button', 'room_directory');
|
Analytics.trackEvent('home_page', 'button', 'room_directory');
|
||||||
|
PosthogTrackers.trackInteraction("WebHomeExploreRoomsButton", ev);
|
||||||
dis.fire(Action.ViewRoomDirectory);
|
dis.fire(Action.ViewRoomDirectory);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,8 @@ import SettingsStore from "../../settings/SettingsStore";
|
||||||
import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts";
|
import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts";
|
||||||
import { shouldShowComponent } from "../../customisations/helpers/UIComponents";
|
import { shouldShowComponent } from "../../customisations/helpers/UIComponents";
|
||||||
import { UIComponent } from "../../settings/UIFeature";
|
import { UIComponent } from "../../settings/UIFeature";
|
||||||
|
import { ButtonEvent } from "../views/elements/AccessibleButton";
|
||||||
|
import PosthogTrackers from "../../PosthogTrackers";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
isMinimized: boolean;
|
isMinimized: boolean;
|
||||||
|
@ -116,8 +118,9 @@ export default class LeftPanel extends React.Component<IProps, IState> {
|
||||||
dis.fire(Action.OpenDialPad);
|
dis.fire(Action.OpenDialPad);
|
||||||
};
|
};
|
||||||
|
|
||||||
private onExplore = () => {
|
private onExplore = (ev: ButtonEvent) => {
|
||||||
dis.fire(Action.ViewRoomDirectory);
|
dis.fire(Action.ViewRoomDirectory);
|
||||||
|
PosthogTrackers.trackInteraction("WebLeftPanelExploreRoomsButton", ev);
|
||||||
};
|
};
|
||||||
|
|
||||||
private refreshStickyHeaders = () => {
|
private refreshStickyHeaders = () => {
|
||||||
|
|
|
@ -142,6 +142,7 @@ const DmAuxButton = ({ tabIndex, dispatcher = defaultDispatcher }: IAuxButtonPro
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
closeMenu();
|
closeMenu();
|
||||||
defaultDispatcher.dispatch({ action: "view_create_chat" });
|
defaultDispatcher.dispatch({ action: "view_create_chat" });
|
||||||
|
PosthogTrackers.trackInteraction("WebRoomListRoomsSublistPlusMenuCreateChatItem", e);
|
||||||
}}
|
}}
|
||||||
/> }
|
/> }
|
||||||
{ showInviteUsers && <IconizedContextMenuOption
|
{ showInviteUsers && <IconizedContextMenuOption
|
||||||
|
@ -178,7 +179,10 @@ const DmAuxButton = ({ tabIndex, dispatcher = defaultDispatcher }: IAuxButtonPro
|
||||||
} else if (!activeSpace && showCreateRooms) {
|
} else if (!activeSpace && showCreateRooms) {
|
||||||
return <AccessibleTooltipButton
|
return <AccessibleTooltipButton
|
||||||
tabIndex={tabIndex}
|
tabIndex={tabIndex}
|
||||||
onClick={() => dispatcher.dispatch({ action: 'view_create_chat' })}
|
onClick={(e) => {
|
||||||
|
dispatcher.dispatch({ action: 'view_create_chat' });
|
||||||
|
PosthogTrackers.trackInteraction("WebRoomListRoomsSublistPlusMenuCreateChatItem", e);
|
||||||
|
}}
|
||||||
className="mx_RoomSublist_auxButton"
|
className="mx_RoomSublist_auxButton"
|
||||||
tooltipClassName="mx_RoomSublist_addRoomTooltip"
|
tooltipClassName="mx_RoomSublist_addRoomTooltip"
|
||||||
aria-label={_t("Start chat")}
|
aria-label={_t("Start chat")}
|
||||||
|
@ -300,6 +304,7 @@ const UntaggedAuxButton = ({ tabIndex }: IAuxButtonProps) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
closeMenu();
|
closeMenu();
|
||||||
|
PosthogTrackers.trackInteraction("WebRoomListRoomsSublistPlusMenuExploreRoomsItem", e);
|
||||||
defaultDispatcher.fire(Action.ViewRoomDirectory);
|
defaultDispatcher.fire(Action.ViewRoomDirectory);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
@ -496,9 +501,10 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private onStartChat = () => {
|
private onStartChat = (ev: ButtonEvent) => {
|
||||||
const initialText = RoomListStore.instance.getFirstNameFilterCondition()?.search;
|
const initialText = RoomListStore.instance.getFirstNameFilterCondition()?.search;
|
||||||
defaultDispatcher.dispatch({ action: "view_create_chat", initialText });
|
defaultDispatcher.dispatch({ action: "view_create_chat", initialText });
|
||||||
|
PosthogTrackers.trackInteraction("WebRoomListRoomsSublistPlusMenuCreateChatItem", ev);
|
||||||
};
|
};
|
||||||
|
|
||||||
private onExplore = (ev: ButtonEvent) => {
|
private onExplore = (ev: ButtonEvent) => {
|
||||||
|
@ -512,6 +518,7 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
|
||||||
} else {
|
} else {
|
||||||
const initialText = RoomListStore.instance.getFirstNameFilterCondition()?.search;
|
const initialText = RoomListStore.instance.getFirstNameFilterCondition()?.search;
|
||||||
defaultDispatcher.dispatch({ action: Action.ViewRoomDirectory, initialText });
|
defaultDispatcher.dispatch({ action: Action.ViewRoomDirectory, initialText });
|
||||||
|
PosthogTrackers.trackInteraction("WebRoomListRoomsSublistPlusMenuExploreRoomsItem", ev);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -297,6 +297,7 @@ const RoomListHeader = ({ onVisibilityChange }: IProps) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
defaultDispatcher.dispatch({ action: "view_create_chat" });
|
defaultDispatcher.dispatch({ action: "view_create_chat" });
|
||||||
|
PosthogTrackers.trackInteraction("WebRoomListHeaderPlusMenuCreateChatItem", e);
|
||||||
closePlusMenu();
|
closePlusMenu();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
@ -335,6 +336,7 @@ const RoomListHeader = ({ onVisibilityChange }: IProps) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
defaultDispatcher.dispatch({ action: Action.ViewRoomDirectory });
|
defaultDispatcher.dispatch({ action: Action.ViewRoomDirectory });
|
||||||
|
PosthogTrackers.trackInteraction("WebRoomListHeaderPlusMenuExploreRoomsItem", e);
|
||||||
closePlusMenu();
|
closePlusMenu();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -6629,9 +6629,9 @@ mathml-tag-names@^2.1.3:
|
||||||
resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3"
|
resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3"
|
||||||
integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==
|
integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==
|
||||||
|
|
||||||
"matrix-analytics-events@github:matrix-org/matrix-analytics-events.git#daad3faed54f0b1f1e026a7498b4653e4d01cd90":
|
"matrix-analytics-events@github:matrix-org/matrix-analytics-events.git#4aef17b56798639906f26a8739043a3c5c5fde7e":
|
||||||
version "0.0.1"
|
version "0.0.1"
|
||||||
resolved "https://codeload.github.com/matrix-org/matrix-analytics-events/tar.gz/daad3faed54f0b1f1e026a7498b4653e4d01cd90"
|
resolved "https://codeload.github.com/matrix-org/matrix-analytics-events/tar.gz/4aef17b56798639906f26a8739043a3c5c5fde7e"
|
||||||
|
|
||||||
matrix-encrypt-attachment@^1.0.3:
|
matrix-encrypt-attachment@^1.0.3:
|
||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
|
|
Loading…
Reference in New Issue