mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-24 17:16:03 +00:00
analytics user UUID
This commit is contained in:
@@ -3,6 +3,7 @@ import { Injectable } from '@angular/core'
|
|||||||
import { ElectronService } from './electron.service'
|
import { ElectronService } from './electron.service'
|
||||||
import { ConfigService } from './config.service'
|
import { ConfigService } from './config.service'
|
||||||
import ua = require('universal-analytics')
|
import ua = require('universal-analytics')
|
||||||
|
import uuidv4 = require('uuid/v4')
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class HomeBaseService {
|
export class HomeBaseService {
|
||||||
@@ -37,7 +38,10 @@ export class HomeBaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enableAnalytics () {
|
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('cd1', this.appVersion)
|
||||||
session.set('cd2', process.platform)
|
session.set('cd2', process.platform)
|
||||||
session.pageview('/').send()
|
session.pageview('/').send()
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
"deep-equal": "1.0.1",
|
"deep-equal": "1.0.1",
|
||||||
"file-loader": "^0.11.2",
|
"file-loader": "^0.11.2",
|
||||||
"rage-edit-tmp": "^1.1.0",
|
"rage-edit-tmp": "^1.1.0",
|
||||||
|
"uuid": "^3.3.2",
|
||||||
"xterm": "^3.6.0"
|
"xterm": "^3.6.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
@@ -168,6 +168,11 @@ thenify-all@^1.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
any-promise "^1.0.0"
|
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:
|
xterm@^3.6.0:
|
||||||
version "3.6.0"
|
version "3.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/xterm/-/xterm-3.6.0.tgz#9b95cd23a338e5842343aec1a104f094c5153e7c"
|
resolved "https://registry.yarnpkg.com/xterm/-/xterm-3.6.0.tgz#9b95cd23a338e5842343aec1a104f094c5153e7c"
|
||||||
|
Reference in New Issue
Block a user