diff --git a/source/package.json b/source/package.json index a8d4a54..b3e7f3c 100644 --- a/source/package.json +++ b/source/package.json @@ -15,6 +15,7 @@ "less": "^4.1.1", "less-loader": "^7.3.0", "lodash": "^4.17.21", + "universal-analytics": "^0.4.23", "uuid": "^8.3.2", "vue": "^2.6.11", "vue-class-component": "^7.2.3", diff --git a/source/src/background.ts b/source/src/background.ts index b0107b4..51eb639 100644 --- a/source/src/background.ts +++ b/source/src/background.ts @@ -1,5 +1,13 @@ import {Msg, Page, PluginEvent} from "@/core/types"; +// @ts-ignore +import * as UA from "universal-analytics" +import {v4} from "uuid" + +// 统计服务 +const userID = localStorage.getItem("userID") || v4() +UA("UA-134924925-3", userID); + console.log("on background") class PortMan {