summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-02-25 20:51:23 +0900
committerGitHub <noreply@github.com>2025-02-25 11:51:23 +0000
commit2b6638e1607e5c44eb6f6dc987e9e893927f1829 (patch)
treef3efba7ca978bd5cf7d32202a014ffb73ac719f6 /packages/frontend/src/components
parentchore(config): migrate renovate config (#15550) (diff)
downloadmisskey-2b6638e1607e5c44eb6f6dc987e9e893927f1829.tar.gz
misskey-2b6638e1607e5c44eb6f6dc987e9e893927f1829.tar.bz2
misskey-2b6638e1607e5c44eb6f6dc987e9e893927f1829.zip
feat: google analytics (#15451)
* wip backend * wip frontend * build misskey-js * implement control panel * fix * introduce analytics wrapper * spdx * Update analytics.ts * Update common.ts * wip * wip * wip * wip * wip * Update CHANGELOG.md --------- Co-authored-by: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com>
Diffstat (limited to 'packages/frontend/src/components')
-rw-r--r--packages/frontend/src/components/MkPageWindow.vue16
1 files changed, 15 insertions, 1 deletions
diff --git a/packages/frontend/src/components/MkPageWindow.vue b/packages/frontend/src/components/MkPageWindow.vue
index 1420b9c26f..e725d2a15d 100644
--- a/packages/frontend/src/components/MkPageWindow.vue
+++ b/packages/frontend/src/components/MkPageWindow.vue
@@ -32,6 +32,7 @@ SPDX-License-Identifier: AGPL-3.0-only
import { computed, onMounted, onUnmounted, provide, ref, shallowRef } from 'vue';
import { url } from '@@/js/config.js';
import { getScrollContainer } from '@@/js/scroll.js';
+import type { PageMetadata } from '@/scripts/page-metadata.js';
import RouterView from '@/components/global/RouterView.vue';
import MkWindow from '@/components/MkWindow.vue';
import { popout as _popout } from '@/scripts/popout.js';
@@ -39,11 +40,11 @@ import { copyToClipboard } from '@/scripts/copy-to-clipboard.js';
import { useScrollPositionManager } from '@/nirax.js';
import { i18n } from '@/i18n.js';
import { provideMetadataReceiver, provideReactiveMetadata } from '@/scripts/page-metadata.js';
-import type { PageMetadata } from '@/scripts/page-metadata.js';
import { openingWindowsCount } from '@/os.js';
import { claimAchievement } from '@/scripts/achievements.js';
import { useRouterFactory } from '@/router/supplier.js';
import { mainRouter } from '@/router/main.js';
+import { analytics } from '@/analytics.js';
const props = defineProps<{
initialPath: string;
@@ -99,6 +100,14 @@ windowRouter.addListener('replace', ctx => {
history.value.push({ path: ctx.path, key: ctx.key });
});
+windowRouter.addListener('change', ctx => {
+ console.log('windowRouter: change', ctx.path);
+ analytics.page({
+ path: ctx.path,
+ title: ctx.path,
+ });
+});
+
windowRouter.init();
provide('router', windowRouter);
@@ -160,6 +169,11 @@ function popout() {
useScrollPositionManager(() => getScrollContainer(contents.value), windowRouter);
onMounted(() => {
+ analytics.page({
+ path: props.initialPath,
+ title: props.initialPath,
+ });
+
openingWindowsCount.value++;
if (openingWindowsCount.value >= 3) {
claimAchievement('open3windows');