Skip to content

Commit

Permalink
added google analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
alivarastepour committed Nov 2, 2023
1 parent 7f22364 commit 4488977
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
import '@/styles/globals.css'
import type { AppProps } from 'next/app'
import "@/styles/globals.css";
import type { AppProps } from "next/app";
import Script from "next/script";

export default function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
return (
<>
<Script
strategy="lazyOnload"
async
src="https://www.googletagmanager.com/gtag/js?id=G-DWSVN55RGN"
></Script>
<Script>
{` window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-DWSVN55RGN');`}
</Script>
<Component {...pageProps} />
</>
);
}

0 comments on commit 4488977

Please sign in to comment.