mirror of
https://github.com/hazemKrimi/personal-website.git
synced 2026-05-01 18:00:26 +00:00
Fix google analytics tracking
This commit is contained in:
+3
-8
@@ -1,5 +1,4 @@
|
||||
import Document, { DocumentContext, Html, Head, Main, NextScript } from 'next/document';
|
||||
import Script from 'next/script';
|
||||
|
||||
import { ServerStyleSheet } from 'styled-components';
|
||||
|
||||
@@ -36,13 +35,9 @@ class Doc extends Document {
|
||||
return (
|
||||
<Html>
|
||||
<Head>
|
||||
<Script
|
||||
strategy='afterInteractive'
|
||||
src={`https://www.googletagmanager.com/gtag/js?id=${GOOGLE_ANALYTICS_KEY}`}
|
||||
/>
|
||||
<Script
|
||||
id='google-analytics'
|
||||
strategy='afterInteractive'
|
||||
<script src={`https://www.googletagmanager.com/gtag/js?id=${GOOGLE_ANALYTICS_KEY}`} />
|
||||
<script
|
||||
id='analytics-init'
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: initAnalytics()
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user