mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-24 04:33:10 +00:00
Co-authored-by: Dan Abramov <dan.abramov@me.com> Co-authored-by: Sylwia Vargas <sylwia.vargas@gmail.com> Co-authored-by: Dan Lebowitz <dan.lebo@me.com> Co-authored-by: Razvan Gradinar <grazvan@fb.com> Co-authored-by: Jared Palmer <jared@palmer.net> Co-authored-by: Dane Grant <danecando@gmail.com> Co-authored-by: Dustin Goodman <dustin.s.goodman@gmail.com> Co-authored-by: Rick Hanlon <rickhanlonii@gmail.com> Co-authored-by: Maggie Appleton <maggie.fm.appleton@gmail.com> Co-authored-by: Alex Moldovan <alex.n.moldovan@gmail.com> Co-authored-by: Ives van Hoorne <ives.v.h@gmail.com> Co-authored-by: Brian Vaughn <bvaughn@fb.com> Co-authored-by: Dmitri Pavlutin <dpavlutin@gmail.com>
36 lines
1.7 KiB
Diff
36 lines
1.7 KiB
Diff
diff --git a/node_modules/@next/plugin-google-analytics/src/document-head-tags-server.js b/node_modules/@next/plugin-google-analytics/src/document-head-tags-server.js
|
|
index d10a05b..b27a7c4 100644
|
|
--- a/node_modules/@next/plugin-google-analytics/src/document-head-tags-server.js
|
|
+++ b/node_modules/@next/plugin-google-analytics/src/document-head-tags-server.js
|
|
@@ -5,7 +5,7 @@ export default async function headTags() {
|
|
<>
|
|
<script
|
|
async
|
|
- src={`https://www.googletagmanager.com/gtag/js?id=${process.env.GA_TRACKING_ID}`}
|
|
+ src={`https://www.googletagmanager.com/gtag/js?id=${process.env.NEXT_PUBLIC_GA_TRACKING_ID}`}
|
|
/>
|
|
<script
|
|
dangerouslySetInnerHTML={{
|
|
@@ -13,7 +13,7 @@ export default async function headTags() {
|
|
window.dataLayer = window.dataLayer || [];
|
|
function gtag(){dataLayer.push(arguments);}
|
|
gtag('js', new Date());
|
|
- gtag('config', '${process.env.GA_TRACKING_ID}');
|
|
+ gtag('config', '${process.env.NEXT_PUBLIC_GA_TRACKING_ID}');
|
|
`,
|
|
}}
|
|
/>
|
|
diff --git a/node_modules/@next/plugin-google-analytics/src/on-init-client.js b/node_modules/@next/plugin-google-analytics/src/on-init-client.js
|
|
index 094b2c9..e250a31 100644
|
|
--- a/node_modules/@next/plugin-google-analytics/src/on-init-client.js
|
|
+++ b/node_modules/@next/plugin-google-analytics/src/on-init-client.js
|
|
@@ -1,7 +1,7 @@
|
|
export default async function initClient({ router }) {
|
|
router.events.on('routeChangeComplete', (url) => {
|
|
setTimeout(() => {
|
|
- window.gtag('config', process.env.GA_TRACKING_ID, {
|
|
+ window.gtag('config', process.env.NEXT_PUBLIC_GA_TRACKING_ID, {
|
|
page_location: url,
|
|
page_title: document.title,
|
|
})
|