Fix - Analytics not working
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,6 +4,7 @@ Thumbs.db
|
|||||||
.idea
|
.idea
|
||||||
.next
|
.next
|
||||||
out
|
out
|
||||||
|
.env
|
||||||
build
|
build
|
||||||
node_modules
|
node_modules
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
|
@ -56,19 +56,15 @@ const Helmet = (props) => (
|
|||||||
<link rel="icon" href="/static/manifest/favicon.ico" type="image/x-icon" />
|
<link rel="icon" href="/static/manifest/favicon.ico" type="image/x-icon" />
|
||||||
|
|
||||||
{ /* Global Site Tag (gtag.js) - Google Analytics */ }
|
{ /* Global Site Tag (gtag.js) - Google Analytics */ }
|
||||||
{ !PHASE_DEVELOPMENT_SERVER && (
|
<script async src={ `https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}` } />
|
||||||
<>
|
<script dangerouslySetInnerHTML={{
|
||||||
<script async src={ `https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}` } />
|
__html: `
|
||||||
<script dangerouslySetInnerHTML={{
|
window.dataLayer = window.dataLayer || [];
|
||||||
__html: `
|
function gtag(){dataLayer.push(arguments);}
|
||||||
window.dataLayer = window.dataLayer || [];
|
gtag('js', new Date());
|
||||||
function gtag(){dataLayer.push(arguments);}
|
gtag('config', '${GA_TRACKING_ID}');
|
||||||
gtag('js', new Date());
|
`,
|
||||||
gtag('config', '${GA_TRACKING_ID}');
|
}} />
|
||||||
`,
|
|
||||||
}} />
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</NextHead>
|
</NextHead>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user