import Document , { Html , Head , Main , NextScript } from 'next/document' ; import { GA_TRACKING_ID } from '../lib/gtag' ; class MyDocument extends Document { static async getInitialProps ( ctx ) { const initialProps = await Document . getInitialProps ( ctx ) ; return { ... initialProps } ; } render ( ) { return ( < Html lang = "pt" > < Head > { } < 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());
            gtag('config', '${ GA_TRACKING_ID }', {
              page_path: window.location.pathname,
            });
          ` , } } /> < link rel = "apple-touch-icon" sizes = "180x180" href = "/apple-touch-icon.png" / > < link rel = "icon" type = "image/png" sizes = "32x32" href = "/favicon-32x32.png" / > < link rel = "icon" type = "image/png" sizes = "16x16" href = "/favicon-16x16.png" / > < link rel = "manifest" href = "/site.webmanifest" / > < link rel = "mask-icon" href = "/safari-pinned-tab.svg" color = "#5bbad5" / > < meta name = "msapplication-TileColor" content = "#ffc40d" / > < meta name = "theme-color" content = "#ffffff" / > < /Head> < body > < Main /> < NextScript / > < /body> < /Html>); } } export default MyDocument ;