mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-05-30 12:39:58 +08:00
update gtag
This commit is contained in:
@@ -15,6 +15,7 @@ import * as JSONStream from 'JSONStream'
|
||||
|
||||
import SqlitePluginModule from '@geekgeekrun/sqlite-plugin'
|
||||
import gtag from '../../utils/gtag'
|
||||
import GtagPlugin from '../../utils/gtag/GtagPlugin'
|
||||
const { default: SqlitePlugin } = SqlitePluginModule
|
||||
|
||||
const rerunInterval = (() => {
|
||||
@@ -31,6 +32,7 @@ const { groupRobotAccessToken: dingTalkAccessToken } = readConfigFile('dingtalk.
|
||||
const initPlugins = (hooks) => {
|
||||
new DingtalkPlugin(dingTalkAccessToken).apply(hooks)
|
||||
new SqlitePlugin(getPublicDbFilePath()).apply(hooks)
|
||||
new GtagPlugin().apply(hooks)
|
||||
}
|
||||
|
||||
let isParentProcessDisconnect = false
|
||||
|
||||
@@ -119,6 +119,7 @@ const attachRequestsListener = async (target: Target) => {
|
||||
},
|
||||
markReason: MarkAsNotSuitReason.USER_MANUAL_OPERATION_WITH_UNKNOWN_REASON
|
||||
}
|
||||
gtag('job_marked_as_not_suit', { markFrom: markDetail.markFrom })
|
||||
if (reasonCodeToTextMap[chosenCode]?.includes('活跃度低')) {
|
||||
markDetail.markReason = MarkAsNotSuitReason.BOSS_INACTIVE
|
||||
markDetail.extInfo.bossActiveTimeDesc = currentJobData?.bossInfo.activeTimeDesc
|
||||
@@ -153,6 +154,7 @@ const attachRequestsListener = async (target: Target) => {
|
||||
const currentUserInfo = await page.evaluate(
|
||||
'document.querySelector(".job-detail-box").__vue__.$store.state.userInfo'
|
||||
)
|
||||
gtag('new_chat_startup', { chatStartupFrom: ChatStartupFrom.ManuallyFromRecommendList })
|
||||
await saveChatStartupRecord(
|
||||
await dbInitPromise,
|
||||
currentJobData,
|
||||
|
||||
18
packages/ui/src/main/utils/gtag/GtagPlugin.ts
Normal file
18
packages/ui/src/main/utils/gtag/GtagPlugin.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import gtag from '.'
|
||||
|
||||
export default class GtagPlugin {
|
||||
apply(hooks) {
|
||||
hooks.newChatStartup.tap('GtagPlugin', (_, { chatStartupFrom }) => {
|
||||
gtag('new_chat_startup', { chatStartupFrom })
|
||||
})
|
||||
hooks.jobMarkedAsNotSuit.tap('GtagPlugin', (_, { markFrom }) => {
|
||||
gtag('job_marked_as_not_suit', { markFrom })
|
||||
})
|
||||
hooks.noPositionFoundForCurrentJob.tap('GtagPlugin', () => {
|
||||
gtag('no_position_found_for_current_job')
|
||||
})
|
||||
hooks.noPositionFoundAfterTraverseAllJob.tap('GtagPlugin', () => {
|
||||
gtag('no_position_found_after_traverse_all_job')
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user