Skip to content

Commit

Permalink
added google analytics support
Browse files Browse the repository at this point in the history
  • Loading branch information
rNLKJA committed May 15, 2024
1 parent 98c1bc3 commit 3978366
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions pages/_document.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Document, { Html, Head, Main, NextScript } from "next/document";
import React from "react";
import Document, { Head, Html, Main, NextScript } from "next/document";

class MyDocument extends Document {
render() {
Expand Down Expand Up @@ -72,6 +71,22 @@ class MyDocument extends Document {
}),
}}
/>

{/* <!-- Google tag (gtag.js) --> */}
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-7W1VX9PH20"
></script>
<script
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-7W1VX9PH20');
`,
}}
/>
</Head>

<body>
Expand Down

1 comment on commit 3978366

@vercel
Copy link

@vercel vercel bot commented on 3978366 May 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.