diff --git a/.env.example b/.env.example index c539b6a..dded42e 100644 --- a/.env.example +++ b/.env.example @@ -8,5 +8,5 @@ NEXT_PUBLIC_APP_URL=https://btc.eh-aye.net # API endpoints (if needed) # NEXT_PUBLIC_API_URL=https://api.eh-aye.net -# Analytics (optional) -# NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX \ No newline at end of file +# Google Analytics (optional) +# NEXT_PUBLIC_GA_MEASUREMENT_ID=G-XXXXXXXXXX \ No newline at end of file diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx index 17a4208..46b75d2 100644 --- a/src/pages/_document.tsx +++ b/src/pages/_document.tsx @@ -1,9 +1,31 @@ import { Head, Html, Main, NextScript } from "next/document"; export default function Document() { + const gaMeasurementId = process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID; + return (
+ {/* Google Analytics - Only included if environment variable is set */} + {gaMeasurementId && ( + <> + + + > + )} + {/* Favicons */}