Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ruisaraiva19 committed Dec 4, 2021
2 parents 9714304 + ad82451 commit a4c638c
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
/* eslint-disable @next/next/no-sync-scripts */
import Document, { Html, Head, Main, NextScript } from 'next/document'

const isProd = process.env.NODE_ENV === 'production'

class MyDocument extends Document {
render() {
return (
<Html lang="en">
<Head>
{isProd && (
<script async src={`https://www.googletagmanager.com/gtag/js?id=${process.env.NEXT_PUBLIC_GTM_ID || ''}`} />
)}
{isProd && (
<script
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', '${process.env.NEXT_PUBLIC_GTM_ID || ''}', { 'anonymize_ip': true });
`,
}}
/>
)}
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="" />
{process.env.NODE_ENV === 'production' && <script async src="https://cdn.splitbee.io/sb.js"></script>}
</Head>
<body className="preload">
<script src="/js/noflash.js" />
Expand Down

0 comments on commit a4c638c

Please sign in to comment.