Commit b49d6499 by 杨北旺

添加埋点开关配置

1 parent 5cc31762
...@@ -7,7 +7,8 @@ const defaultData = { ...@@ -7,7 +7,8 @@ const defaultData = {
server_url: 'http://tracking-backend.test.glsx.com/track', server_url: 'http://tracking-backend.test.glsx.com/track',
send_timeout: 6000, send_timeout: 6000,
max_length: 10, max_length: 10,
show_log: true show_log: true,
switch:true
} }
const commonData = {} const commonData = {}
function init({ settings, common,getTitle }) { function init({ settings, common,getTitle }) {
...@@ -372,6 +373,9 @@ tracker.trackEvent = trackEvent ...@@ -372,6 +373,9 @@ tracker.trackEvent = trackEvent
tracker.sendStrategy = sendStrategy tracker.sendStrategy = sendStrategy
// eventType 事件类型 properties 业务对象 callback 回调 // eventType 事件类型 properties 业务对象 callback 回调
tracker.track = function (properties, eventType = 'click', callback) { tracker.track = function (properties, eventType = 'click', callback) {
if(!defaultData.switch){
return
}
this.trackEvent.send( this.trackEvent.send(
{ {
type: 'track', type: 'track',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!