Skip to content

Commit b3abe33

Browse files
committed
fix: stamp CLI telemetry with the canonical global-config machine id
1 parent f5fff00 commit b3abe33

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

packages/telemetry/cli.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ export const sendEvent = async ({ event, version, properties }) => {
1111
return;
1212
}
1313

14-
// The WTS client reads the machine id from `~/.webiny/config` (user.id field)
15-
// via the same path globalConfig writes to. No need to pass user explicitly.
16-
const wts = new WTS({ source: "cli" });
14+
// Use the canonical Webiny machine id — the top-level `id` field in
15+
// `~/.webiny/config`, owned by @webiny/global-config. The admin app
16+
// (REACT_APP_WEBINY_TELEMETRY_USER_ID) and the website install/finish alias
17+
// both key off this same id, so passing it here keeps CLI, admin, and
18+
// website events on a single PostHog person. Without it, the WTS client
19+
// falls back to its own `user.id` field, which is a different UUID and
20+
// fragments funnels across surfaces.
21+
const wts = new WTS({ source: "cli", distinctId: globalConfig.get("id") });
1722

1823
const wcpProperties = {};
1924
const [wcpOrgId, wcpProjectId] = getWcpOrgProjectId();

0 commit comments

Comments
 (0)