11import '~/src/styles/reset.css'
22import '~/src/styles/colors.css'
3+ import 'lazysizes'
34import 'highlight.js/styles/hybrid.css'
45
56import { AppProps } from 'next/app'
@@ -16,28 +17,20 @@ function MyApp({ Component, pageProps }: AppProps) {
1617 < Component { ...pageProps } />
1718 { GA_ID !== undefined && (
1819 < >
20+ < Script src = { `https://www.googletagmanager.com/gtag/js?id=${ GA_ID } ` } />
1921 < Script
20- src = { `https://www.googletagmanager.com/gtag/js?id=${ GA_ID } ` }
21- onLoad = { ( ) => {
22- const script = document . createElement ( 'script' )
23- script . innerHTML = `
24- window.dataLayer = window.dataLayer || [];
25- function gtag(){dataLayer.push(arguments);}
26- gtag('js', new Date());
27- gtag('config', '${ GA_ID } ', {
28- page_path: window.location.pathname,
29- });`
30- document . body . appendChild ( script )
22+ id = "gtag"
23+ dangerouslySetInnerHTML = { {
24+ __html : `window.dataLayer = window.dataLayer || [];
25+ function gtag(){dataLayer.push(arguments);}
26+ gtag('js', new Date());
27+ gtag('config', '${ GA_ID } ', {
28+ page_path: window.location.pathname,
29+ });` ,
3130 } }
3231 />
3332 </ >
3433 ) }
35- < Script
36- strategy = "beforeInteractive"
37- src = "https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.3.2/lazysizes.min.js"
38- integrity = "sha512-q583ppKrCRc7N5O0n2nzUiJ+suUv7Et1JGels4bXOaMFQcamPk9HjdUknZuuFjBNs7tsMuadge5k9RzdmO+1GQ=="
39- crossOrigin = "anonymous"
40- />
4134 </ >
4235 )
4336}
0 commit comments