From 8a59997abb51f51a522ff559176980b91abfb546 Mon Sep 17 00:00:00 2001 From: Tan Nguyen Date: Thu, 31 Oct 2024 22:36:37 +0700 Subject: [PATCH] feat: add manual cloudflare analytic --- .env.example | 2 ++ docusaurus.config.ts | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/.env.example b/.env.example index 94f5500..17b589f 100644 --- a/.env.example +++ b/.env.example @@ -12,3 +12,5 @@ ALGOLIA_INDEX_NAME=cslant ALGOLIA_SEARCH_PAGE_PATH=search GOOGLE_ANALYTICS_ID=G-57GJ9G7S4GB + +CLOUDFLARE_ANALYTICS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxx diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 6f28143..858e71d 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -78,6 +78,14 @@ const config: Config = { }, prism: PrismConfig, algolia: AlgoliaConfig, + + scripts: [ + { + src: 'https://static.cloudflareinsights.com/beacon.min.js', + async: true, + 'data-cf-beacon': `{"token": "${process.env.CLOUDFLARE_ANALYTICS_TOKEN}"}`, + }, + ], } satisfies Preset.ThemeConfig, plugins: [