21 lines
541 B
TypeScript
21 lines
541 B
TypeScript
import 'styles/globals.css';
|
|
import type { AppProps } from 'next/app';
|
|
import Layout from 'components/Layout';
|
|
import TagManager from 'react-gtm-module';
|
|
import { useEffect } from 'react';
|
|
|
|
function MyApp({ Component, pageProps }: AppProps) {
|
|
useEffect(() => {
|
|
if (process.env.NEXT_PUBLIC_GTM_ID && process.env.NEXT_PUBLIC_GTM_ID.length > 0) {
|
|
TagManager.initialize({ gtmId: process.env.NEXT_PUBLIC_GTM_ID });
|
|
}
|
|
}, []);
|
|
return (
|
|
<Layout>
|
|
<Component {...pageProps} />
|
|
</Layout>
|
|
);
|
|
}
|
|
|
|
export default MyApp;
|