Skip to content

Commit

Permalink
fix(create-gatsby) the sessionId is supposed to be the same for the w…
Browse files Browse the repository at this point in the history
…hole duration of the session (#28864)

* 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 <[email protected]>

Co-authored-by: Matt Kane <[email protected]>
  • Loading branch information
jamo and ascorbic authored Jan 5, 2021
1 parent a135c50 commit de87590
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/create-gatsby/src/tracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export interface ITrackCliArgs {
siteHash?: string
}

const sessionId = uuidv4()

export const trackCli = (eventType: string, args?: ITrackCliArgs): void => {
fetch(analyticsApi, {
method: `POST`,
Expand All @@ -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,
Expand Down

0 comments on commit de87590

Please sign in to comment.