Skip to content

Commit c73f329

Browse files
1 parent 758cab2 commit c73f329

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

pages/_app.tsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
11
import type { AppProps } from 'next/app'
2+
import Script from 'next/script'
3+
24
import 'antd/dist/antd.css'
35

46
function MyApp({ Component, pageProps }: AppProps) {
5-
return <Component {...pageProps} />
7+
return (
8+
<>
9+
<Component {...pageProps} />
10+
<Script
11+
src="https://www.googletagmanager.com/gtag/js?id=G-6GC4XK3S9Z"
12+
strategy="afterInteractive"
13+
/>
14+
<Script id="google-analytics" strategy="afterInteractive">
15+
{`
16+
window.dataLayer = window.dataLayer || [];
17+
function gtag(){window.dataLayer.push(arguments);}
18+
gtag('js', new Date());
19+
20+
gtag('config', 'G-6GC4XK3S9Z');
21+
`}
22+
</Script>
23+
</>
24+
25+
)
626
}
727

828
export default MyApp

0 commit comments

Comments
 (0)