Browse Source

feat 埋点增加useragent

erekook 1 year ago
parent
commit
3603d3bf05
1 changed files with 4 additions and 1 deletions
  1. 4 1
      utils/util.js

+ 4 - 1
utils/util.js

@@ -133,6 +133,8 @@ export const SendEvent = (eventName, eventParam, self) => {
         const app = self || getApp()
         let eParam = {...eventParam}
 
+        const deviceInfo = wx.getDeviceInfo()
+
         let opt = {
             app_id: apple.appKey,
             app_channel: apple.ghid,
@@ -141,7 +143,8 @@ export const SendEvent = (eventName, eventParam, self) => {
             os_type: 1,
             event_value: JSON.stringify(eParam),
             report_time: Date.now(),
-            trace_id: uuid()
+            trace_id: uuid(),
+            user_agent: JSON.stringify(deviceInfo)
         }
 
         opt.union_id = app.globalData.unionId || ''