diff --git a/src/components/GoogleTagManager.jsx b/src/components/GoogleTagManager.jsx new file mode 100644 index 00000000..3d32abe7 --- /dev/null +++ b/src/components/GoogleTagManager.jsx @@ -0,0 +1,31 @@ +import * as React from "react"; +import Script from "next/script"; + +// Google Tag Manager ID +const GTM_ID = "GTM-PGWDPDN3"; + +export const GoogleTagManagerHeadScript = () => { + return ( + + ); +}; + +export const GoogleTageManagerBodyScript = () => { + return ( + + ); +}; diff --git a/src/pages/_document.jsx b/src/pages/_document.jsx index b3493318..25d8d20a 100644 --- a/src/pages/_document.jsx +++ b/src/pages/_document.jsx @@ -1,4 +1,5 @@ import { Head, Html, Main, NextScript } from 'next/document' +import {GoogleTageManagerBodyScript, GoogleTagManagerHeadScript} from "@/components/GoogleTagManager"; const modeScript = ` let darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)') @@ -39,10 +40,12 @@ export default function Document() { return (
- +