mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-07-17 01:05:21 -05:00
ga only in prod
This commit is contained in:
parent
6231c67030
commit
b27d338fb6
|
|
@ -21,13 +21,15 @@ class MyDocument extends Document {
|
|||
<Html>
|
||||
<Head>
|
||||
{/* Global Site Tag (gtag.js) - Google Analytics */}
|
||||
<script
|
||||
async
|
||||
src={`https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}`}
|
||||
/>
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
{process.env.NODE_ENV === "production" && (
|
||||
<>
|
||||
<script
|
||||
async
|
||||
src={`https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}`}
|
||||
/>
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
|
@ -35,8 +37,10 @@ class MyDocument extends Document {
|
|||
page_path: window.location.pathname,
|
||||
});
|
||||
`,
|
||||
}}
|
||||
/>
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</Head>
|
||||
<body>
|
||||
<ColorModeScript />
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user