diff --git a/src/etoro.tsx b/src/etoro.tsx index 2758d94..2247cb1 100644 --- a/src/etoro.tsx +++ b/src/etoro.tsx @@ -21,7 +21,8 @@ import { registeredPortfolioHeaderExtraButtons } from '@/components/Portfolio/Po import { registeredExecutionDialogControls } from '@/components/ExecutionDialog/ExecutionDialogControls' import { registeredExecutionDialogTakeProfitControls } from '@/components/ExecutionDialog/ExecutionDialogTakeProfitControls' import { registeredExecutionDialogStopLossControls } from '@/components/ExecutionDialog/ExecutionDialogStopLossControls' -import { gaAPI } from '@/gaAPI' +import { gaAPI, GaTargetEventId } from '@/gaAPI' +import packageJSON from '../package.json' type $ = JQueryStatic globalThis.localStorage.setItem('debug', `${debugAPI.log.namespace}:*`) @@ -42,6 +43,13 @@ $('body').delegate( }, 1000), ) +emitter.once(Events.ready).then(function sendVersionToAnalytics() { + gaAPI.sendEvent( + GaTargetEventId.universal_bootstrapWithVersion, + `version=${packageJSON.version}`, + ) +}) + /** * 以事件驅動分別在各頁面中,渲染「本腳本」的各個部件到 etoro 頁面上 * diff --git a/src/gaAPI.ts b/src/gaAPI.ts index d8c387d..a280ffc 100644 --- a/src/gaAPI.ts +++ b/src/gaAPI.ts @@ -6,6 +6,7 @@ import store from '@/store/_store' * e.g. {category}_{event} */ export enum GaTargetEventId { + universal_bootstrapWithVersion, sidebar_extensionMenuItemClick, watchlists_balanceLinkClick, watchlists_portfolioLinkClick,