Skip to content

Commit

Permalink
Add Google analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
seadeep42 committed Oct 19, 2024
1 parent 15f7fae commit 39bdd72
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"react-dom": "^18.2.0",
"react-router-dom": "^6.19.0",
"sass": "^1.69.5",
"vite-plugin-html-config": "^2.0.2"
"vite-plugin-html-config": "^2.0.2",
"vite-plugin-radar": "^0.9.6"
},
"devDependencies": {
"@iconify/react": "^4.1.1",
Expand Down
12 changes: 11 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { resolve } from "path";
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { VitePluginRadar } from 'vite-plugin-radar';
import htmlPlugin from 'vite-plugin-html-config';

const htmlPluginOptions = process.env.NODE_ENV !== "development" ? {} : {
Expand All @@ -18,5 +19,14 @@ const htmlPluginOptions = process.env.NODE_ENV !== "development" ? {} : {

export default defineConfig({
envDir: resolve(__dirname),
plugins: [react(), htmlPlugin(htmlPluginOptions)],
plugins: [
react(),
VitePluginRadar({
// Google Analytics tag injection
analytics: {
id: 'G-1FX33BYDE4',
},
}),
htmlPlugin(htmlPluginOptions)
],
})
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2498,6 +2498,11 @@ vite-plugin-html-config@^2.0.2:
resolved "https://registry.yarnpkg.com/vite-plugin-html-config/-/vite-plugin-html-config-2.0.2.tgz#b58a474c1bc1a838ea3c849844ece545a5fc0216"
integrity sha512-g09u0XsmgKyMUIp1RZSyNSkJWvIusaXxw3KylyxU3vkCq7/G8hyemLctT+4IvO42fCPlNySmrNC9g0qSoKmvpw==

vite-plugin-radar@^0.9.6:
version "0.9.6"
resolved "https://registry.yarnpkg.com/vite-plugin-radar/-/vite-plugin-radar-0.9.6.tgz#59ae700d478e495cad0c46f7b968550690dbd234"
integrity sha512-tLvUt7+iZznxYa8GmCrZBV3Q0fLQApsyg9EIJgaen8DjGky3vFIq9KoDWAoVMs9FZ5qbsSBb3YfSvoqwVV+5xw==

vite@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/vite/-/vite-5.0.0.tgz#3bfb65acda2a97127e4fa240156664a1f234ce08"
Expand Down

0 comments on commit 39bdd72

Please sign in to comment.