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) (#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 <matt@gatsbyjs.com>

Co-authored-by: Matt Kane <matt@gatsbyjs.com>
(cherry picked from commit de87590)

Co-authored-by: Jarmo Isotalo <jamo@isotalo.fi>
  • Loading branch information
GatsbyJS Bot and jamo committed Jan 5, 2021
1 parent 6b7c5e7 commit 0c1c807
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/create-gatsby/src/tracking.ts
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 0c1c807

Please sign in to comment.