From 0c1c8076b442bcf2e4bdaa70dd56b7392ed7e550 Mon Sep 17 00:00:00 2001 From: GatsbyJS Bot Date: Tue, 5 Jan 2021 12:47:03 -0500 Subject: [PATCH] fix(create-gatsby) the sessionId is supposed to be the same for the whole duration of the session (#28864) (#28870) * fix(create-gatsby) the sessionIs is supposed to be the same for the whole duration of the session * Update packages/create-gatsby/src/tracking.ts Co-authored-by: Matt Kane Co-authored-by: Matt Kane (cherry picked from commit de8759002872c8fcf3bf9598dcf19573f9b712d5) Co-authored-by: Jarmo Isotalo --- packages/create-gatsby/src/tracking.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/create-gatsby/src/tracking.ts b/packages/create-gatsby/src/tracking.ts index 3be9b29e740d9..640ee1b6638ca 100644 --- a/packages/create-gatsby/src/tracking.ts +++ b/packages/create-gatsby/src/tracking.ts @@ -26,6 +26,8 @@ export interface ITrackCliArgs { siteHash?: string } +const sessionId = uuidv4() + export const trackCli = (eventType: string, args?: ITrackCliArgs): void => { fetch(analyticsApi, { method: `POST`, @@ -36,7 +38,7 @@ export const trackCli = (eventType: string, args?: ITrackCliArgs): void => { body: JSON.stringify({ eventType, time: new Date(), - sessionId: uuidv4(), + sessionId, machineId: getMachineId(), componentId: `create-gatsby`, componentVersion: 1,