Wire up bunch of interaction events into Posthog (#7707)
This commit is contained in:
parent
5620b83d34
commit
999e1b7421
12 changed files with 120 additions and 26 deletions
|
@ -21,6 +21,7 @@ import { DebouncedFunc, throttle } from 'lodash';
|
|||
import { EventType, RelationType } from "matrix-js-sdk/src/@types/event";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
import { Room } from 'matrix-js-sdk/src/models/room';
|
||||
import { Composer as ComposerEvent } from "matrix-analytics-events/types/typescript/Composer";
|
||||
|
||||
import dis from '../../../dispatcher/dispatcher';
|
||||
import EditorModel from '../../../editor/model';
|
||||
|
@ -57,6 +58,7 @@ import DocumentPosition from "../../../editor/position";
|
|||
import { ComposerType } from "../../../dispatcher/payloads/ComposerInsertPayload";
|
||||
import { getSlashCommand, isSlashCommand, runSlashCommand, shouldSendAnyway } from "../../../editor/commands";
|
||||
import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts";
|
||||
import { PosthogAnalytics } from "../../../PosthogAnalytics";
|
||||
|
||||
interface IAddReplyOpts {
|
||||
permalinkCreator?: RoomPermalinkCreator;
|
||||
|
@ -344,6 +346,13 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
|
|||
return;
|
||||
}
|
||||
|
||||
PosthogAnalytics.instance.trackEvent<ComposerEvent>({
|
||||
eventName: "Composer",
|
||||
isEditing: false,
|
||||
inThread: this.props.relation?.rel_type === RelationType.Thread,
|
||||
isReply: !!this.props.replyToEvent,
|
||||
});
|
||||
|
||||
// Replace emoticon at the end of the message
|
||||
if (SettingsStore.getValue('MessageComposerInput.autoReplaceEmoji')) {
|
||||
const indexOfLastPart = model.parts.length - 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue