diff --git a/package.json b/package.json index 9b80ba9..0b7b829 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "@commitlint/cli": "^18.2.0", "@commitlint/config-conventional": "^18.1.0", "@tanstack/eslint-plugin-query": "^5.6.0", + "@types/gtag.js": "^0.0.18", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", diff --git a/src/app/GoogleAnalytics.tsx b/src/app/GoogleAnalytics.tsx new file mode 100644 index 0000000..efc94eb --- /dev/null +++ b/src/app/GoogleAnalytics.tsx @@ -0,0 +1,37 @@ +'use client'; + +import Script from 'next/script'; + +import * as gtag from '@/utils/gtag'; + +export default function GoogleAnalytics() { + gtag.useGtag(); + + return ( + <> + {process.env.NODE_ENV !== 'development' && ( + <> + {/* Global Site Tag (gtag.js) - Google Analytics */} +