Browse Source
Merge pull request #955 from gre/analytics-missing-os
add missing OS info in analytics
master
Gaëtan Renaudeau
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
0 deletions
-
src/analytics/segment.js
|
|
@ -13,8 +13,13 @@ import { load } from './inject-in-window' |
|
|
|
invariant(typeof window !== 'undefined', 'analytics/segment must be called on renderer thread') |
|
|
|
|
|
|
|
let user = null |
|
|
|
let osType = '?' |
|
|
|
let osVersion = '?' |
|
|
|
if (!process.env.STORYBOOK_ENV) { |
|
|
|
user = require('helpers/user').default |
|
|
|
const os = require('os') |
|
|
|
osType = os.type() |
|
|
|
osVersion = os.release() |
|
|
|
} |
|
|
|
|
|
|
|
const sessionId = uuid() |
|
|
@ -38,6 +43,8 @@ const extraProperties = store => { |
|
|
|
environment: __DEV__ ? 'development' : 'production', |
|
|
|
systemLanguage: systemLocale.language, |
|
|
|
systemRegion: systemLocale.region, |
|
|
|
osType, |
|
|
|
osVersion, |
|
|
|
sessionId, |
|
|
|
...deviceInfo, |
|
|
|
} |
|
|
|