mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-09-06 07:56:56 +08:00
✨ Feature: add baidu tongji for analytics
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
const isDevelopment = process.env.NODE_ENV !== 'production'
|
||||
/* eslint-disable camelcase */
|
||||
export const handleBaiduTongJiEvent = (data: IBaiduTongJiOptions) => {
|
||||
const { category, action, opt_label = '', opt_value = Date.now() } = data
|
||||
window._hmt.push(['_trackEvent', category, action, opt_label, opt_value])
|
||||
if (isDevelopment) {
|
||||
console.log('baidu tongji', data)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user