diff --git a/frontend/.env.example b/frontend/.env.example index 8f3ed551..3003b919 100644 --- a/frontend/.env.example +++ b/frontend/.env.example @@ -1 +1,2 @@ VITE_API_BASE=https://temp-email-api.xxx.xxx +VITE_CF_WEB_ANALY_TOKEN= diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 50749368..2e85eb3b 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -64,6 +64,16 @@ const newEmail = async () => { onMounted(async () => { await refresh(); + const token = import.meta.env.VITE_CF_WEB_ANALY_TOKEN; + + if (token) { + const script = document.createElement('script'); + script.defer = true; + script.src = 'https://static.cloudflareinsights.com/beacon.min.js'; + script.dataset.cfBeacon = `{ token: ${token} }`; + document.body.appendChild(script); + } + });