Events to track:
Request from: p1597310072473200-slack-CRWCHQGUB
We do have a small, but functional, tracking implementation in the editing toolkit:
I wonder if it's worth moving that to the common directory: https://github.com/Automattic/wp-calypso/blob/master/apps/editing-toolkit/editing-toolkit-plugin/common/index.php
Also looks like we can use recordTracksEvent
pulled from @automattic/calypso-analytics
, which is used here: https://github.com/automattic/wp-calypso/blob/HEAD/apps/editing-toolkit/editing-toolkit-plugin/editor-gutenboarding-launch/index.ts#L8, which might be a bit easier.
Also looks like we can use recordTracksEvent pulled from @automattic/calypso-analytics
Nice! Totally missed that.
Also looks like we can use
recordTracksEvent
pulled from@automattic/calypso-analytics
, which is used here: https://github.com/automattic/wp-calypso/blob/HEAD/apps/editing-toolkit/editing-toolkit-plugin/editor-gutenboarding-launch/index.ts#L8, which might be a bit easier.
In the calypso-analytics readme it says:
In most situations it is best to use the Analytics Middleware, which has no direct browser dependencies and therefore will not complicate any unit testing of the modules where it is used.
I don't have the context yet to judge if it is better to use the middleware approach. Any thoughts?
I don't have the context yet to judge if it is better to use the middleware approach. Any thoughts?
I think it's okay to ignore that advice when we're using the tracking methods in the Editing Toolkit. The middleware doesn't exist in that app, and I don't think we're going to patch it in.
You're pretty safe following the examples from https://github.com/automattic/wp-calypso/blob/HEAD/apps/editing-toolkit/editing-toolkit-plugin/editor-gutenboarding-launch/index.ts#L8 and https://github.com/automattic/wp-calypso/blob/HEAD/apps/editing-toolkit/editing-toolkit-plugin/editor-gutenboarding-launch/index.ts#L76 I reckon.
You can go ahead and implement what you think is right, then we can 馃憖 at it and worry about tracking event property names and so on in the PR review comments.
Implemented in https://github.com/Automattic/wp-calypso/pull/45429