Send how many favorited rooms a user has to Posthog (#7772)
This commit is contained in:
parent
871032e1bc
commit
f6565bfbc8
13 changed files with 47 additions and 15 deletions
|
@ -26,13 +26,14 @@ import dis from "../../dispatcher/dispatcher";
|
|||
import { Action } from "../../dispatcher/actions";
|
||||
import BaseAvatar from "../views/avatars/BaseAvatar";
|
||||
import { OwnProfileStore } from "../../stores/OwnProfileStore";
|
||||
import AccessibleButton from "../views/elements/AccessibleButton";
|
||||
import AccessibleButton, { ButtonEvent } from "../views/elements/AccessibleButton";
|
||||
import { UPDATE_EVENT } from "../../stores/AsyncStore";
|
||||
import { useEventEmitter } from "../../hooks/useEventEmitter";
|
||||
import MatrixClientContext from "../../contexts/MatrixClientContext";
|
||||
import MiniAvatarUploader, { AVATAR_SIZE } from "../views/elements/MiniAvatarUploader";
|
||||
import Analytics from "../../Analytics";
|
||||
import CountlyAnalytics from "../../CountlyAnalytics";
|
||||
import PosthogTrackers from "../../PosthogTrackers";
|
||||
|
||||
const onClickSendDm = () => {
|
||||
Analytics.trackEvent('home_page', 'button', 'dm');
|
||||
|
@ -46,9 +47,10 @@ const onClickExplore = () => {
|
|||
dis.fire(Action.ViewRoomDirectory);
|
||||
};
|
||||
|
||||
const onClickNewRoom = () => {
|
||||
const onClickNewRoom = (ev: ButtonEvent) => {
|
||||
Analytics.trackEvent('home_page', 'button', 'create_room');
|
||||
CountlyAnalytics.instance.track("home_page_button", { button: "create_room" });
|
||||
PosthogTrackers.trackInteraction("WebHomeCreateRoomButton", ev);
|
||||
dis.dispatch({ action: 'view_create_room' });
|
||||
};
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ import Spinner from "../views/elements/Spinner";
|
|||
import { ActionPayload } from "../../dispatcher/payloads";
|
||||
import { getDisplayAliasForAliasSet } from "../../Rooms";
|
||||
import { Action } from "../../dispatcher/actions";
|
||||
import PosthogTrackers from "../../PosthogTrackers";
|
||||
|
||||
const MAX_NAME_LENGTH = 80;
|
||||
const MAX_TOPIC_LENGTH = 800;
|
||||
|
@ -477,13 +478,14 @@ export default class RoomDirectory extends React.Component<IProps, IState> {
|
|||
ev.stopPropagation();
|
||||
};
|
||||
|
||||
private onCreateRoomClick = () => {
|
||||
private onCreateRoomClick = (ev: ButtonEvent) => {
|
||||
this.onFinished();
|
||||
dis.dispatch({
|
||||
action: 'view_create_room',
|
||||
public: true,
|
||||
defaultName: this.state.filterString.trim(),
|
||||
});
|
||||
PosthogTrackers.trackInteraction("WebRoomDirectoryCreateRoomButton", ev);
|
||||
};
|
||||
|
||||
private showRoomAlias(alias: string, autoJoin = false) {
|
||||
|
|
|
@ -84,6 +84,7 @@ import { useRoomState } from "../../hooks/useRoomState";
|
|||
import { shouldShowComponent } from "../../customisations/helpers/UIComponents";
|
||||
import { UIComponent } from "../../settings/UIFeature";
|
||||
import { UPDATE_EVENT } from "../../stores/AsyncStore";
|
||||
import PosthogTrackers from "../../PosthogTrackers";
|
||||
|
||||
interface IProps {
|
||||
space: Room;
|
||||
|
@ -386,6 +387,7 @@ const SpaceLandingAddButton = ({ space }) => {
|
|||
e.stopPropagation();
|
||||
closeMenu();
|
||||
|
||||
PosthogTrackers.trackInteraction("WebSpaceHomeCreateRoomButton", e);
|
||||
if (await showCreateNewRoom(space)) {
|
||||
defaultDispatcher.fire(Action.UpdateSpaceHierarchy);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue