Skip to content

Commit 702718f

Browse files
committed
.
1 parent ee86db3 commit 702718f

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed

gatsby-config.js

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,35 @@ module.exports = {
7979
},
8080
],
8181
},
82-
}
82+
},
83+
{
84+
resolve: `gatsby-plugin-google-gtag`,
85+
options: {
86+
// You can add multiple tracking ids and a pageview event will be fired for all of them.
87+
trackingIds: [
88+
"G-WJCFMQ7HGP"
89+
],
90+
// This object gets passed directly to the gtag config command
91+
// This config will be shared across all trackingIds
92+
gtagConfig: {
93+
optimize_id: "OPT_CONTAINER_ID",
94+
anonymize_ip: true,
95+
cookie_expires: 0,
96+
},
97+
// This object is used for configuration specific to this plugin
98+
pluginConfig: {
99+
// Puts tracking script in the head instead of the body
100+
head: false,
101+
// Setting this parameter is also optional
102+
respectDNT: true,
103+
// Avoids sending pageview hits from custom paths
104+
exclude: ["/preview/**", "/do-not-track/me/too/"],
105+
// Defaults to https://www.googletagmanager.com
106+
origin: "YOUR_SELF_HOSTED_ORIGIN",
107+
// Delays processing pageview events on route update (in milliseconds)
108+
delayOnRouteUpdate: 0,
109+
},
110+
},
111+
},
83112
],
84113
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"@mui/material": "^5.11.4",
2424
"gatsby": "^5.4.1",
2525
"gatsby-plugin-emotion": "^8.4.0",
26+
"gatsby-plugin-google-gtag": "^5.14.0",
2627
"gatsby-plugin-material-ui": "^4.0.2",
2728
"gatsby-remark-external-links": "^0.0.4",
2829
"gatsby-remark-prismjs": "^7.4.0",

yarn.lock

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,13 @@
10411041
dependencies:
10421042
regenerator-runtime "^0.13.11"
10431043

1044+
"@babel/runtime@^7.20.13":
1045+
version "7.26.0"
1046+
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.0.tgz#8600c2f595f277c60815256418b85356a65173c1"
1047+
integrity sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==
1048+
dependencies:
1049+
regenerator-runtime "^0.14.0"
1050+
10441051
"@babel/template@^7.18.10", "@babel/template@^7.20.7":
10451052
version "7.20.7"
10461053
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8"
@@ -5568,6 +5575,14 @@ gatsby-plugin-emotion@^8.4.0:
55685575
"@babel/runtime" "^7.20.7"
55695576
"@emotion/babel-preset-css-prop" "^11.2.0"
55705577

5578+
gatsby-plugin-google-gtag@^5.14.0:
5579+
version "5.14.0"
5580+
resolved "https://registry.yarnpkg.com/gatsby-plugin-google-gtag/-/gatsby-plugin-google-gtag-5.14.0.tgz#89f520481e20cc0830a52334f7f19d08be547d11"
5581+
integrity sha512-iXBQR4xjU20vR1b0zSE1McDxJZdm3pNxm8FMSvFIa9IswZskRgnjSYUBjGLMeGf8+t8y8rSTie94Ni0pJqf6dA==
5582+
dependencies:
5583+
"@babel/runtime" "^7.20.13"
5584+
minimatch "^3.1.2"
5585+
55715586
gatsby-plugin-material-ui@^4.0.2:
55725587
version "4.1.0"
55735588
resolved "https://registry.yarnpkg.com/gatsby-plugin-material-ui/-/gatsby-plugin-material-ui-4.1.0.tgz#068b3c9318fd0539d647a55e5108377695e8a602"
@@ -9041,6 +9056,11 @@ regenerator-runtime@^0.13.11, regenerator-runtime@^0.13.7:
90419056
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9"
90429057
integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==
90439058

9059+
regenerator-runtime@^0.14.0:
9060+
version "0.14.1"
9061+
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f"
9062+
integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==
9063+
90449064
regenerator-transform@^0.15.1:
90459065
version "0.15.1"
90469066
resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.1.tgz#f6c4e99fc1b4591f780db2586328e4d9a9d8dc56"

0 commit comments

Comments
 (0)