diff --git a/gatsby-config.ts b/gatsby-config.ts index 4cbaf5c..38527b8 100644 --- a/gatsby-config.ts +++ b/gatsby-config.ts @@ -157,6 +157,19 @@ const config: GatsbyConfig = { queries: myCustomQueries, }, }, + { + resolve: `gatsby-plugin-google-gtag`, + options: { + trackingIds: [ + process.env.GATSBY_APP_GA_ID, // Google Analytics + ], + pluginConfig: { + head: false, + respectDNT: true, + delayOnRouteUpdate: 1000, + }, + }, + }, ], jsxRuntime: 'automatic', }; diff --git a/package.json b/package.json index c7f83fc..0cdf35d 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "framer-motion": "^11.3.31", "gatsby": "^5.13.1", "gatsby-image": "^3.11.0", + "gatsby-plugin-google-gtag": "^5.13.1", "gatsby-plugin-image": "^3.13.0", "gatsby-plugin-manifest": "^5.13.0", "gatsby-plugin-react-svg": "^3.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e4245d4..1eb5a19 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: gatsby-image: specifier: ^3.11.0 version: 3.11.0 + gatsby-plugin-google-gtag: + specifier: ^5.13.1 + version: 5.13.1(gatsby@5.13.7(babel-eslint@10.1.0(eslint@8.57.0))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(type-fest@0.21.3)(typescript@5.5.4))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) gatsby-plugin-image: specifier: ^3.13.0 version: 3.13.1(omuwha3bvagmvpnnmv5q7pz3su) @@ -3471,6 +3474,14 @@ packages: eslint-webpack-plugin: ^2.4.3 || ^3 || ^4 gatsby: ^2 || ^3 || ^4 || ^5 + gatsby-plugin-google-gtag@5.13.1: + resolution: {integrity: sha512-aaJKIDwUWwhooJnalse1uvcusBmCwCVK33pp1IrDU02E7IohMen3eR5TsjLbfKO7Z+SbfKJEqUoi/r0ozrJarA==} + engines: {node: '>=18.0.0'} + peerDependencies: + gatsby: ^5.0.0-next + react: ^18.0.0 || ^0.0.0 + react-dom: ^18.0.0 || ^0.0.0 + gatsby-plugin-image@3.13.1: resolution: {integrity: sha512-v5jGXxjr//iLk7LzpW6RW/9H4KNVezxee2Sgy9mxvdvekTuFQLYoQmtk2jOZINMZMP3Vm+Rl3MqWWVMfhHuWFw==} peerDependencies: @@ -10861,6 +10872,14 @@ snapshots: gatsby: 5.13.7(babel-eslint@10.1.0(eslint@8.57.0))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(type-fest@0.21.3)(typescript@5.5.4) webpack-merge: 5.10.0 + gatsby-plugin-google-gtag@5.13.1(gatsby@5.13.7(babel-eslint@10.1.0(eslint@8.57.0))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(type-fest@0.21.3)(typescript@5.5.4))(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + dependencies: + '@babel/runtime': 7.25.6 + gatsby: 5.13.7(babel-eslint@10.1.0(eslint@8.57.0))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(type-fest@0.21.3)(typescript@5.5.4) + minimatch: 3.1.2 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + gatsby-plugin-image@3.13.1(omuwha3bvagmvpnnmv5q7pz3su): dependencies: '@babel/code-frame': 7.24.7