feat: move to nextjs
This commit is contained in:
26
components/Analytics.tsx
Normal file
26
components/Analytics.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import Script from "next/script";
|
||||
|
||||
const GA_ID = "G-QFNMM9LXBY";
|
||||
|
||||
export const Analytics = () => {
|
||||
return (
|
||||
<>
|
||||
<Script
|
||||
strategy="afterInteractive"
|
||||
src={`https://www.googletagmanager.com/gtag/js?id=${GA_ID}`}
|
||||
/>
|
||||
<Script
|
||||
id="google-analytics"
|
||||
strategy="afterInteractive"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '${GA_ID}');
|
||||
`,
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user