Feature: add baidu tongji for analytics

This commit is contained in:
PiEgg
2021-04-05 17:47:06 +08:00
parent 3fd6e4e4c8
commit f53639153e
8 changed files with 113 additions and 1 deletions
+4
View File
@@ -1,3 +1,7 @@
export const SHOW_INPUT_BOX = 'SHOW_INPUT_BOX'
export const SHOW_INPUT_BOX_RESPONSE = 'SHOW_INPUT_BOX_RESPONSE'
export const TOGGLE_SHORTKEY_MODIFIED_MODE = 'TOGGLE_SHORTKEY_MODIFIED_MODE'
export const BAIDU_TONGJI_INIT = 'BAIDU_TONDJI_INIT'
export const BAIDU_TONGJI_INIT_RES = 'BAIDU_TONDJI_INIT_RES'
export const BAIDU_TONGJI_CODE = '19a7ebdbb87f2403773c7ab0cae16d21'
export const BAIDU_TONGJI_EVENT = 'BAIDU_TONGJI_EVENT'
+4
View File
@@ -10,4 +10,8 @@ declare global {
[elem: string]: any
}
}
interface Window {
_hmt: any[]
}
}
+16
View File
@@ -295,3 +295,19 @@ interface IAppNotification {
body: string
icon?: string
}
interface IBaiduTongJiOptions {
category: string
action: string
// eslint-disable-next-line camelcase
opt_label?: string
// eslint-disable-next-line camelcase
opt_value?: number
}
interface IAnalyticsData {
fromClipboard: boolean
type: string
count: number
duration?: number // 耗时
}