diff --git a/jest.config.js b/jest.config.js index c695365965a6cbc61c4efeb2a5830262bddd9caf..cc530b6329e4b7b5e8feaeef5390972f673b17e7 100644 --- a/jest.config.js +++ b/jest.config.js @@ -10,7 +10,7 @@ module.exports = { clearMocks: true, - collectCoverage: true, + collectCoverage: false, coverageDirectory: 'coverage', diff --git a/public/tencent14464934467995274316.txt b/public/tencent14464934467995274316.txt deleted file mode 100644 index a2996cd87e31f1466ca2ad304372d147d6f84927..0000000000000000000000000000000000000000 --- a/public/tencent14464934467995274316.txt +++ /dev/null @@ -1 +0,0 @@ -235605460366578863 \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index f44961ae46d9f3e9730f1b79957ae9d8c7f72d75..407c490c0a30fcaacb17b5aab41ae4dc5cec8eec 100644 --- a/src/App.vue +++ b/src/App.vue @@ -91,7 +91,7 @@ import { NOT_COMPATIBLE_AGENTS, TRIGGER_PROBABILITY, } from '@/utils/constant' -import { recordClick } from '@/utils/ga' +import { recordEvent } from '@/utils/ga' import Confetti from './components/Confetti.vue' @@ -117,6 +117,10 @@ function handleGenerate() { const randomOption = getRandomAvatarOption(avatarOption.value) setAvatarOption(randomOption) } + + recordEvent('click_randomize', { + event_category: 'click', + }) } const downloadModalVisible = ref(false) @@ -150,6 +154,10 @@ async function handleDownload() { trigger.click() } } + + recordEvent('click_download', { + event_category: 'click', + }) } finally { setTimeout(() => { downloading.value = false @@ -164,21 +172,33 @@ function handleAction(actionType: ActionType) { switch (actionType) { case ActionType.Undo: store.commit(UNDO) + recordEvent('action_undo', { + event_category: 'action', + event_label: 'Undo', + }) break case ActionType.Redo: store.commit(REDO) + recordEvent('action_redo', { + event_category: 'action', + event_label: 'Redo', + }) break case ActionType.Flip: flipped.value = !flipped.value + recordEvent('action_flip_avatar', { + event_category: 'action', + event_label: 'Flip Avatar', + }) break case ActionType.Code: codeVisible.value = !codeVisible.value - recordClick({ - event_category: 'code', - event_label: 'view code', + recordEvent('action_view_code', { + event_category: 'action', + event_label: 'View Avatar Option Code', }) break } @@ -267,7 +287,7 @@ function handleAction(actionType: ActionType) { height: 100%; overflow: hidden; - @mixin gradient-block($color) { + @mixin gradient-style($color) { position: absolute; width: 100vh; height: 100vh; @@ -284,14 +304,14 @@ function handleAction(actionType: ActionType) { } .gradient-top { - @include gradient-block($color-secondary); + @include gradient-style($color-secondary); top: -50%; right: -20%; } .gradient-bottom { - @include gradient-block($color-accent); + @include gradient-style($color-accent); bottom: -50%; left: -20%; diff --git a/src/env.d.ts b/src/env.d.ts index 59af2f2519fe2a05642873e9cd365c842dc4de18..6154aca7cc5ad414c2003bf7b8d1b34b406a046a 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -9,5 +9,5 @@ declare module '*.vue' { interface Window { // eslint-disable-next-line @typescript-eslint/no-explicit-any - gtag: any + gtag: (...params: any[]) => void } diff --git a/src/layouts/Header.vue b/src/layouts/Header.vue index 831bd303e90b67f9e96f59dca85752dc311a3910..6696be0cf56a53c3d8cd23ac36056577810a1158 100644 --- a/src/layouts/Header.vue +++ b/src/layouts/Header.vue @@ -10,7 +10,14 @@ target="_blank" rel="nofollow noopener noreferrer" > - @@ -22,6 +29,7 @@