-
-
Notifications
You must be signed in to change notification settings - Fork 812
Integrate analytics stubs #7186
Conversation
* Make IEvent look like a stub definition * Update pageview tracking to track screens, using a hypothetical definition of a screen event * Remove distinction between pseudo and anon tracking, will need to rework it considering stubs
(importing MatrixChat into PosthogAnalytics causes tests to fail :(
turt2live
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise lgtm - thanks!
package.json
Outdated
| "katex": "^0.12.0", | ||
| "linkifyjs": "^2.1.9", | ||
| "lodash": "^4.17.20", | ||
| "matrix-analytics-events": "https://github.com/matrix-org/matrix-analytics-events.git", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preferably this ends up on npm or at least tied to a commit, to avoid cases where we're debugging different checkouts and versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we depend on the js-sdk? I think it's kind of a similar situation..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During development the package.json points to github:matrix-org/matrix-js-sdk#develop. However the release script will replace that value with a version deployed to npm during the release cycle.
This happens in element-web/release.sh or matrix-react-sdk/release.sh for example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, when it's in develop we have the checkout linked anyways so it doesn't really affect much. The widget-api though doesn't traditionally get linked in dev, so we use an npm release. For the linter stuff, we point at a commit for reasons I cannot recall.
| if (this.accountPasswordTimer !== null) clearTimeout(this.accountPasswordTimer); | ||
| } | ||
|
|
||
| trackScreenChange(durationMs: number): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explicit member access please
test/PosthogAnalytics-test.ts
Outdated
| foo: string; | ||
| }; | ||
| export interface ITestEvent extends IEvent { | ||
| eventName: "jest_test_event"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should follow our own docs in tests too 😇
| eventName: "jest_test_event"; | |
| eventName: "JestTestEvent"; |
This is fine for now; when we need an updated version of the stubs to raise new events we can just bump the githash to a newer version
Integrate Error and Screen event types from https://github.com/matrix-org/matrix-analytics-events
This PR currently has no changelog labels, so will not be included in changelogs.
A reviewer can add one of:
T-Deprecation,T-Enhancement,T-Defect,T-Taskto indicate what type of change this is, or addType: [enhancement/defect/task]to the description and I'll add them for you.Preview: https://61ade273238b958da8153a92--matrix-react-sdk.netlify.app
⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.