diff --git a/README.md b/README.md index c700c03..0c39672 100644 --- a/README.md +++ b/README.md @@ -263,7 +263,7 @@ APP_DEEP_LINK_URL= 平台地址未配置时,按钮显示“前往下载页”,沿用上游 `AppAddr` 或 `/app/download/` 跳转;未配置 App 深链时隐藏打开 App 入口。链接保留原始跳转地址,不生成设计示例中的安装包、描述文件或 App Store 地址。 -谷歌统计(GA4)由 `GOOGLE_ANALYTICS_ID` 配置,三套环境默认 `G-269F3ZFQFQ`,在根布局通过 `next/script` 于页面可交互后加载;留空即关闭。 +谷歌统计(GA4)由 `GOOGLE_ANALYTICS_ID` 配置,三套环境默认 `G-269F3ZFQFQ`,在根布局通过 `next/script` 于页面可交互后加载;留空即关闭。Yandex.Metrika 由 `YANDEX_METRIKA_ID` 配置,三套环境默认 `113657403`,同样在根布局加载并带 noscript 像素;留空即关闭。 所有 Telegram 联系入口(页尾、官方导航、回家的路、播放页链接、2257/DMCA、意见反馈,以及 Telegram 形式的「联系我们」客服链接)统一使用 `CONTACT_TELEGRAM_URL`,三套环境默认 `https://t.me/jbd125`,覆盖上游 `tgGroup`、`telegram`、`telegramAdd`。值无效时回退为默认账号。 diff --git a/config/development.env b/config/development.env index 6f469cd..7aedf71 100644 --- a/config/development.env +++ b/config/development.env @@ -19,6 +19,8 @@ SEO_BAIDU_SITE_VERIFICATION= SEO_BAIDU_HTML_FILE= # Google Analytics 4 measurement ID; leave empty to disable. GOOGLE_ANALYTICS_ID=G-269F3ZFQFQ +# Yandex.Metrika counter ID; leave empty to disable. +YANDEX_METRIKA_ID=113657403 # Telegram contact for every TG entry (footer, navigation, return-home, legal pages, customer service). CONTACT_TELEGRAM_URL=https://t.me/jbd125 APP_IOS_STORE_URL= diff --git a/config/production.env b/config/production.env index 2316d8d..c362650 100644 --- a/config/production.env +++ b/config/production.env @@ -15,6 +15,8 @@ SEO_BAIDU_SITE_VERIFICATION= SEO_BAIDU_HTML_FILE= # Google Analytics 4 measurement ID; leave empty to disable. GOOGLE_ANALYTICS_ID=G-269F3ZFQFQ +# Yandex.Metrika counter ID; leave empty to disable. +YANDEX_METRIKA_ID=113657403 # Telegram contact for every TG entry (footer, navigation, return-home, legal pages, customer service). CONTACT_TELEGRAM_URL=https://t.me/jbd125 APP_IOS_STORE_URL= diff --git a/config/test.env b/config/test.env index 4d88cbc..b258f9b 100644 --- a/config/test.env +++ b/config/test.env @@ -15,6 +15,8 @@ SEO_BAIDU_SITE_VERIFICATION= SEO_BAIDU_HTML_FILE= # Google Analytics 4 measurement ID; leave empty to disable. GOOGLE_ANALYTICS_ID=G-269F3ZFQFQ +# Yandex.Metrika counter ID; leave empty to disable. +YANDEX_METRIKA_ID=113657403 # Telegram contact for every TG entry (footer, navigation, return-home, legal pages, customer service). CONTACT_TELEGRAM_URL=https://t.me/jbd125 APP_IOS_STORE_URL= diff --git a/src/app/layout.tsx b/src/app/layout.tsx index e35c71c..404edbe 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -39,6 +39,7 @@ import "@/styles/overrides/pwa-safe-area.css"; import type { ReactNode } from "react"; import { PwaProvider } from "@/components/pwa/PwaProvider"; import { GoogleAnalytics } from "@/components/analytics/GoogleAnalytics"; +import { YandexMetrika } from "@/components/analytics/YandexMetrika"; import { serverConfig } from "@/server/config"; import { pwaViewport } from "@/lib/pwa/config"; import { getRequestPage } from "@/server/react/request-page"; @@ -83,7 +84,7 @@ export default async function RootLayout({ /> )} -