Browse Source

[add][埋点 postId]

zhangwei 2 years ago
parent
commit
4500380246
2 changed files with 11 additions and 9 deletions
  1. 0 7
      src/entry/background.js
  2. 11 2
      src/logic/background/twitter.js

+ 0 - 7
src/entry/background.js

@@ -112,13 +112,6 @@ function thenInstalledMethod() {
             //開始後每一分鐘執行一次(該值不能小于1) 
             periodInMinutes: 1
         });
-        setTimeout(() => {
-            // 安装成功埋点
-            Report.reportLog({
-                objectType: Report.objectType.background_function_try,
-                funcName: 'onInstalledMethod'
-            });
-        }, 5000);
     } catch (error) {
         Report.reportLog({
             objectType: Report.objectType.background_function_catch,

+ 11 - 2
src/logic/background/twitter.js

@@ -3,7 +3,7 @@ import { LANDING_PAGE, LANDING_PAGE_MID, setChromeStorage, setChromeCookie, getC
 import { guid } from '@/uilts/help.js'
 import { discordAuthRedirectUri } from '@/http/configAPI'
 import { setContentMessage } from '@/logic/background/help.js'
-
+import Report from "@/log-center/log"
 let authToken = ''
 let consumerKey = ''
 let tab_flag = true
@@ -250,7 +250,16 @@ function sendActivetabMessage(message = {}) {
  */
 
 export function onInstalledCreateTab() {
-    getChromeCookie(LANDING_PAGE_JUMP_INFO, (res) => {
+    getChromeCookie(LANDING_PAGE_JUMP_INFO, (res = {}) => {
+        setTimeout(() => {
+            // 安装成功埋点
+            Report.reportLog({
+                objectType: Report.objectType.chrome_extension_installed,
+                funcName: 'onInstalledCreateTab',
+                postId: res.postId || ''
+            })
+        }, 5000)
+
         // jump_info
         if (!res || !res.jump_type) {
             chrome.tabs.create({