Skip to content

Commit

Permalink
HOTFIX - Direct analytics imbed (#102)
Browse files Browse the repository at this point in the history
Co-authored-by: marcaufderheyde <[email protected]>
  • Loading branch information
marcaufderheyde and marcaufderheyde authored Jul 19, 2024
1 parent 6ade92e commit 16c6b52
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/[locale]/(withheaderfooter)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility
import AgeVerification from '../../Components/AgeVerification';
import { GoogleAnalytics } from '@next/third-parties/google';
import { GoogleTagManager } from '@next/third-parties/google';
import Script from 'next/script';

const inter = Inter({ subsets: ['latin'] });

Expand Down Expand Up @@ -57,6 +58,20 @@ export default function LocaleLayout({
<Footer />
</NextIntlClientProvider>
<GoogleTagManager gtmId="GTM-PBKDVXT9" />
<Script
async
strategy="lazyOnload"
src="https://www.googletagmanager.com/gtag/js?id=G-7NZJ6HL34T"
></Script>
<Script strategy="lazyOnload">
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-7NZJ6HL34T');
`}
</Script>
</div>
);
}
15 changes: 15 additions & 0 deletions app/[locale]/(withoutheaderfooter)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility
import AgeVerification from '../../Components/AgeVerification';
import { GoogleAnalytics } from '@next/third-parties/google';
import { GoogleTagManager } from '@next/third-parties/google';
import Script from 'next/script';

const inter = Inter({ subsets: ['latin'] });

Expand Down Expand Up @@ -49,6 +50,20 @@ export default function LocaleLayout({
{children}
</NextIntlClientProvider>
<GoogleTagManager gtmId="GTM-PBKDVXT9" />
<Script
async
strategy="lazyOnload"
src="https://www.googletagmanager.com/gtag/js?id=G-7NZJ6HL34T"
></Script>
<Script strategy="lazyOnload">
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-7NZJ6HL34T');
`}
</Script>
</div>
);
}
1 change: 1 addition & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility
import './globals.css';
import { GoogleAnalytics } from '@next/third-parties/google';
import { GoogleTagManager } from '@next/third-parties/google';
import Script from 'next/script';

const inter = Inter({ subsets: ['latin'] });

Expand Down

0 comments on commit 16c6b52

Please sign in to comment.