mirror of
https://github.com/ruisaraiva19/favycon.git
synced 2026-09-14 11:06:21 +05:00
* feat(cypress): setup cypress with Next.js * ci(cypress): run cypress on pull requests * refactor(cypress): migrate from tsconfig.json to .eslintrc.json * ci: update job names * ci(cypress): save cypress artifacts * fix(analytics): fix analytics extra script html tags
37 lines
877 B
TypeScript
37 lines
877 B
TypeScript
import React from 'react'
|
|
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=UA-171039315-1" />}
|
|
{isProd && (
|
|
<script
|
|
dangerouslySetInnerHTML={{
|
|
__html: `
|
|
window.dataLayer = window.dataLayer || [];
|
|
function gtag() { dataLayer.push(arguments); }
|
|
gtag('js', new Date());
|
|
gtag('config', 'UA-171039315-1', { 'anonymize_ip': true });
|
|
`,
|
|
}}
|
|
/>
|
|
)}
|
|
</Head>
|
|
<body className="preload">
|
|
<script src="/js/noflash.js" />
|
|
<Main />
|
|
<NextScript />
|
|
<script src="/js/onload.js" />
|
|
</body>
|
|
</Html>
|
|
)
|
|
}
|
|
}
|
|
|
|
export default MyDocument
|