add gtag
This commit is contained in:
parent
8c2f0793c8
commit
f5986b0037
2
.env
2
.env
|
@ -1 +1 @@
|
|||
DATE_OF_THE_EXAM=2021-06-22T00:00:00.000Z
|
||||
DATE_OF_THE_EXAM=2021-06-22T00:00:00.000Z
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
GA_TRACKING_ID=G-355ES1R23J
|
|
@ -34,7 +34,24 @@ export default class MyDocument extends Document {
|
|||
render() {
|
||||
return (
|
||||
<Html>
|
||||
<Head />
|
||||
<Head>
|
||||
<script
|
||||
async
|
||||
src={`https://www.googletagmanager.com/gtag/js?id=${process.env.GA_TRACKING_ID}`}
|
||||
/>
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '${process.env.GA_TRACKING_ID}', {
|
||||
page_path: window.location.pathname,
|
||||
});
|
||||
`,
|
||||
}}
|
||||
/>
|
||||
</Head>
|
||||
<body>
|
||||
<Main />
|
||||
<NextScript />
|
||||
|
|
|
@ -269,6 +269,7 @@ function PrivacyPolicyPage() {
|
|||
<Link
|
||||
title="Google Ads"
|
||||
href="https://www.google.com/ads/preferences/"
|
||||
style={{ wordBreak: 'break-all' }}
|
||||
>
|
||||
https://www.google.com/ads/preferences/
|
||||
</Link>
|
||||
|
|
Reference in New Issue