feat: 添加 Google Analytics 代码。

This commit is contained in:
Ivan Li 2021-07-25 22:36:20 +08:00
parent 0934ee746a
commit 6738d0f516

View File

@ -23,6 +23,17 @@ function MyApp({ Component, pageProps }) {
<ApolloProvider client={apolloClient}>
<Head>
<title>Ivans Blog</title>
<script
async
src="https://www.googletagmanager.com/gtag/js?id=UA-120892498-1"
></script>
{`<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-120892498-1');
</script>`}
</Head>
<ThemeProvider>
<div className={styles.page}>