Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 8dd0722

Browse files
authored
Update eventName=Screen to $screen to match PostHog's special behaviour (#7667)
1 parent 5b99930 commit 8dd0722

File tree

5 files changed

+25
-11
lines changed

5 files changed

+25
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"katex": "^0.12.0",
9191
"lodash": "^4.17.20",
9292
"maplibre-gl": "^1.15.2",
93-
"matrix-analytics-events": "github:matrix-org/matrix-analytics-events.git#1eab4356548c97722a183912fda1ceabbe8cc7c1",
93+
"matrix-analytics-events": "github:matrix-org/matrix-analytics-events.git#dfa6feaa12bcfc8e99b05a148e12fff7f9d62f08",
9494
"matrix-events-sdk": "^0.0.1-beta.6",
9595
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop",
9696
"matrix-widget-api": "^0.1.0-beta.18",

scripts/ci/install-deps.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@
33
set -ex
44

55
scripts/fetchdep.sh matrix-org matrix-js-sdk
6-
76
pushd matrix-js-sdk
87
yarn link
98
yarn install --pure-lockfile $@
109
popd
1110

11+
scripts/fetchdep.sh matrix-org matrix-analytics-events main
12+
pushd matrix-analytics-events
13+
yarn link
14+
yarn install --pure-lockfile $@
15+
popd
16+
1217
yarn link matrix-js-sdk
18+
yarn link matrix-analytics-events
1319
yarn install --pure-lockfile $@

scripts/ci/layered.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,16 @@ yarn link
1616
yarn install --pure-lockfile
1717
popd
1818

19+
# Set up the js-sdk first
20+
scripts/fetchdep.sh matrix-org matrix-analytics-events main
21+
pushd matrix-analytics-events
22+
yarn link
23+
yarn install --pure-lockfile
24+
popd
25+
1926
# Now set up the react-sdk
2027
yarn link matrix-js-sdk
28+
yarn link matrix-analytics-events
2129
yarn link
2230
yarn install --pure-lockfile
2331
yarn reskindex

src/components/structures/MatrixChat.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -472,17 +472,17 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
472472
}
473473

474474
public trackScreenChange(durationMs: number): void {
475-
const notLoggedInMap = {};
475+
const notLoggedInMap: Partial<Record<Views, ScreenEvent["screenName"]>> = {};
476476
notLoggedInMap[Views.LOADING] = "WebLoading";
477-
notLoggedInMap[Views.WELCOME] = "WebWelcome";
478-
notLoggedInMap[Views.LOGIN] = "WebLogin";
479-
notLoggedInMap[Views.REGISTER] = "WebRegister";
480-
notLoggedInMap[Views.FORGOT_PASSWORD] = "WebForgotPassword";
477+
notLoggedInMap[Views.WELCOME] = "Welcome";
478+
notLoggedInMap[Views.LOGIN] = "Login";
479+
notLoggedInMap[Views.REGISTER] = "Register";
480+
notLoggedInMap[Views.FORGOT_PASSWORD] = "ForgotPassword";
481481
notLoggedInMap[Views.COMPLETE_SECURITY] = "WebCompleteSecurity";
482482
notLoggedInMap[Views.E2E_SETUP] = "WebE2ESetup";
483483
notLoggedInMap[Views.SOFT_LOGOUT] = "WebSoftLogout";
484484

485-
const loggedInPageTypeMap = {};
485+
const loggedInPageTypeMap: Partial<Record<PageType, ScreenEvent["screenName"]>> = {};
486486
loggedInPageTypeMap[PageType.HomePage] = "Home";
487487
loggedInPageTypeMap[PageType.RoomView] = "Room";
488488
loggedInPageTypeMap[PageType.RoomDirectory] = "RoomDirectory";
@@ -495,7 +495,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
495495
notLoggedInMap[this.state.view];
496496

497497
return PosthogAnalytics.instance.trackEvent<ScreenEvent>({
498-
eventName: "Screen",
498+
eventName: "$screen",
499499
screenName,
500500
durationMs,
501501
});

yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6214,9 +6214,9 @@ mathml-tag-names@^2.1.3:
62146214
resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3"
62156215
integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==
62166216

6217-
"matrix-analytics-events@github:matrix-org/matrix-analytics-events.git#1eab4356548c97722a183912fda1ceabbe8cc7c1":
6217+
"matrix-analytics-events@github:matrix-org/matrix-analytics-events.git#dfa6feaa12bcfc8e99b05a148e12fff7f9d62f08":
62186218
version "0.0.1"
6219-
resolved "https://codeload.github.com/matrix-org/matrix-analytics-events/tar.gz/1eab4356548c97722a183912fda1ceabbe8cc7c1"
6219+
resolved "https://codeload.github.com/matrix-org/matrix-analytics-events/tar.gz/dfa6feaa12bcfc8e99b05a148e12fff7f9d62f08"
62206220

62216221
matrix-events-sdk@^0.0.1-beta.6:
62226222
version "0.0.1-beta.6"

0 commit comments

Comments
 (0)