diff --git a/.env.example b/.env.example index 5aca3df..aac003d 100644 --- a/.env.example +++ b/.env.example @@ -55,3 +55,15 @@ TTS_SPEECH_MODEL=mimo-v2.5-tts # true → return a placeholder image instead of calling the image model. # Text/story/voice still run normally. Great for iterating on TTS. MOCK_IMAGE=false + +# ---- 6. Analytics · Umami (optional — leave blank to disable) ------ +# Privacy-friendly, cookieless page-view stats — no Cookie consent banner. +# Cloud: sign up at https://cloud.umami.is, add your site, copy its ID into +# NEXT_PUBLIC_UMAMI_WEBSITE_ID and use the cloud script URL: +# NEXT_PUBLIC_UMAMI_SRC=https://cloud.umami.is/script.js +# Self-host later: point SRC at your own instance — the integration is identical +# (no code change), e.g. NEXT_PUBLIC_UMAMI_SRC=https://stats.example.com/script.js +# Both blank → no script is injected (zero tracking). NEXT_PUBLIC_ vars are +# inlined at BUILD time, so set them in the build env (Vercel project settings). +NEXT_PUBLIC_UMAMI_SRC= +NEXT_PUBLIC_UMAMI_WEBSITE_ID= diff --git a/app/layout.tsx b/app/layout.tsx index bf87079..ec8a719 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,5 +1,6 @@ import type { Metadata } from "next"; import { Cormorant_Garamond, Inter } from "next/font/google"; +import { Analytics } from "@/components/Analytics"; import "./globals.css"; // Editorial fonts: drive tailwind `font-serif`/`font-sans` via @@ -44,6 +45,7 @@ export default function RootLayout({ {children} + ); diff --git a/app/page.tsx b/app/page.tsx index 2b2a59d..d859020 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -744,6 +744,8 @@ export default function HomePage() { 目前,内测期间生成的内容不会被保存,如有需要,请通过录屏或截图等方式保存游玩体验,并记录下生成故事时的提示词与风格选项等。
AI 生成的内容不代表本团队立场。 +
+ 本站使用开源的 Umami 进行隐私友好的匿名访问统计:不使用 Cookie、不收集个人信息、不做跨站追踪。

diff --git a/components/Analytics.tsx b/components/Analytics.tsx new file mode 100644 index 0000000..375e3cc --- /dev/null +++ b/components/Analytics.tsx @@ -0,0 +1,18 @@ +import Script from "next/script"; + +// Privacy-friendly, cookieless page-view analytics (Umami). Both env vars +// unset → render nothing, so local dev and forks never report to our instance. +export function Analytics() { + const src = process.env.NEXT_PUBLIC_UMAMI_SRC; + const websiteId = process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID; + if (!src || !websiteId) return null; + + return ( +