import React from "react" ; import NextDocument , { Html , Head , Main , NextScript } from "next/document" ; import { getCssText } from "../stitches.config" ; export default class Document extends NextDocument { render ( ) { return ( < Html lang = "en" > < Head > < style id = "stitches" dangerouslySetInnerHTML = { { __html : getCssText ( ) } } /> { } < script async src = { `https://www.googletagmanager.com/gtag/js?id=${ process . env . NEXT_PUBLIC_GOOGLE_ANALYTICS }` } /> < script dangerouslySetInnerHTML = { { __html : `
            window.dataLayer = window.dataLayer || [];
            function gtag(){dataLayer.push(arguments);}
            gtag('js', new Date());
            gtag('config', '${ process . env . NEXT_PUBLIC_GOOGLE_ANALYTICS }', {
              page_path: window.location.pathname,
            });
          ` , } } /> < link rel = "icon" href = "/favicon.png" / > < /Head> < body > < Main /> < NextScript / > < /body> < /Html>); } }