mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-08 00:47:15 +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 SqlitePluginModule from '@geekgeekrun/sqlite-plugin'
|
||||||
import gtag from '../../utils/gtag'
|
import gtag from '../../utils/gtag'
|
||||||
|
import GtagPlugin from '../../utils/gtag/GtagPlugin'
|
||||||
const { default: SqlitePlugin } = SqlitePluginModule
|
const { default: SqlitePlugin } = SqlitePluginModule
|
||||||
|
|
||||||
const rerunInterval = (() => {
|
const rerunInterval = (() => {
|
||||||
@@ -31,6 +32,7 @@ const { groupRobotAccessToken: dingTalkAccessToken } = readConfigFile('dingtalk.
|
|||||||
const initPlugins = (hooks) => {
|
const initPlugins = (hooks) => {
|
||||||
new DingtalkPlugin(dingTalkAccessToken).apply(hooks)
|
new DingtalkPlugin(dingTalkAccessToken).apply(hooks)
|
||||||
new SqlitePlugin(getPublicDbFilePath()).apply(hooks)
|
new SqlitePlugin(getPublicDbFilePath()).apply(hooks)
|
||||||
|
new GtagPlugin().apply(hooks)
|
||||||
}
|
}
|
||||||
|
|
||||||
let isParentProcessDisconnect = false
|
let isParentProcessDisconnect = false
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ const attachRequestsListener = async (target: Target) => {
|
|||||||
},
|
},
|
||||||
markReason: MarkAsNotSuitReason.USER_MANUAL_OPERATION_WITH_UNKNOWN_REASON
|
markReason: MarkAsNotSuitReason.USER_MANUAL_OPERATION_WITH_UNKNOWN_REASON
|
||||||
}
|
}
|
||||||
|
gtag('job_marked_as_not_suit', { markFrom: markDetail.markFrom })
|
||||||
if (reasonCodeToTextMap[chosenCode]?.includes('活跃度低')) {
|
if (reasonCodeToTextMap[chosenCode]?.includes('活跃度低')) {
|
||||||
markDetail.markReason = MarkAsNotSuitReason.BOSS_INACTIVE
|
markDetail.markReason = MarkAsNotSuitReason.BOSS_INACTIVE
|
||||||
markDetail.extInfo.bossActiveTimeDesc = currentJobData?.bossInfo.activeTimeDesc
|
markDetail.extInfo.bossActiveTimeDesc = currentJobData?.bossInfo.activeTimeDesc
|
||||||
@@ -153,6 +154,7 @@ const attachRequestsListener = async (target: Target) => {
|
|||||||
const currentUserInfo = await page.evaluate(
|
const currentUserInfo = await page.evaluate(
|
||||||
'document.querySelector(".job-detail-box").__vue__.$store.state.userInfo'
|
'document.querySelector(".job-detail-box").__vue__.$store.state.userInfo'
|
||||||
)
|
)
|
||||||
|
gtag('new_chat_startup', { chatStartupFrom: ChatStartupFrom.ManuallyFromRecommendList })
|
||||||
await saveChatStartupRecord(
|
await saveChatStartupRecord(
|
||||||
await dbInitPromise,
|
await dbInitPromise,
|
||||||
currentJobData,
|
currentJobData,
|
||||||
|
|||||||
@@ -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