diff --git a/.env.example b/.env.example index 48bbdf1..565f0c4 100644 --- a/.env.example +++ b/.env.example @@ -11,3 +11,7 @@ GOOGLE_CALLBACK_URL=http://localhost:3000/auth/google/callback GITHUB_CLIENT_ID=your-github-client-id GITHUB_CLIENT_SECRET=your-github-client-secret GITHUB_CALLBACK_URL=http://localhost:3000/auth/github/callback + +# Google Analytics Configuration (optional) +# Get your tracking ID from https://analytics.google.com +GA_TRACKING_ID= diff --git a/README.md b/README.md index c75f6a4..56e199a 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,20 @@ Edit `src/App.vue` to customize the appearance and functionality of the frontend You can enable or disable OAuth providers by setting or removing their credentials in the `.env` file. At least one provider must be configured for authentication to work. +### Set Up Google Analytics (Optional) + +To track user analytics with Google Analytics: + +1. Create a Google Analytics account at [analytics.google.com](https://analytics.google.com) +2. Create a new property for your application +3. Get your Measurement ID (format: `G-XXXXXXXXXX`) +4. In both `src/index.html` and `src/login.html`, replace **both occurrences** of `G-XXXXXXXXXX` with your actual tracking ID: + - One in the script `src` attribute: `` + - One in the `gtag('config', 'YOUR_ID')` call +5. Rebuild the frontend with `npm run build` + +The Google Analytics tracking code is located in the `` section of both HTML files and will track page views and user interactions automatically. + ### Add More Features - Add more OAuth providers (Twitter, Facebook, etc.) diff --git a/src/index.html b/src/index.html index ece47e0..df6b76b 100644 --- a/src/index.html +++ b/src/index.html @@ -4,6 +4,16 @@ WebSocket Chat - Vue.js + + + + +
diff --git a/src/login.html b/src/login.html index 116cfd7..2967b4c 100644 --- a/src/login.html +++ b/src/login.html @@ -4,6 +4,17 @@ Login - WebSocket Game + + + + + +