提交 822e068b 编写于 作者: E Eugene Pankov

analytics user UUID

上级 9f35ab1a
......@@ -3,6 +3,7 @@ import { Injectable } from '@angular/core'
import { ElectronService } from './electron.service'
import { ConfigService } from './config.service'
import ua = require('universal-analytics')
import uuidv4 = require('uuid/v4')
@Injectable()
export class HomeBaseService {
......@@ -37,7 +38,10 @@ export class HomeBaseService {
}
enableAnalytics () {
const session = ua('UA-3278102-20')
if (!window.localStorage.analyticsUserID) {
window.localStorage.analyticsUserID = uuidv4()
}
const session = ua('UA-3278102-20', window.localStorage.analyticsUserID)
session.set('cd1', this.appVersion)
session.set('cd2', process.platform)
session.pageview('/').send()
......
......@@ -25,6 +25,7 @@
"deep-equal": "1.0.1",
"file-loader": "^0.11.2",
"rage-edit-tmp": "^1.1.0",
"uuid": "^3.3.2",
"xterm": "^3.6.0"
},
"peerDependencies": {
......
......@@ -168,6 +168,11 @@ thenify-all@^1.0.0:
dependencies:
any-promise "^1.0.0"
uuid@^3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==
xterm@^3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/xterm/-/xterm-3.6.0.tgz#9b95cd23a338e5842343aec1a104f094c5153e7c"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册