Skip to content

Commit

Permalink
fix: fix Google analytics (#1800)
Browse files Browse the repository at this point in the history
* save

* test

* test

* connect

* save
  • Loading branch information
dschlabach authored Feb 20, 2025
1 parent c03df5b commit 08f49a6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions apps/web/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import localFont from 'next/font/local';
import { Footer } from 'apps/web/src/components/Layout/Footer/Footer';
import DatadogInit from 'apps/web/app/datadog';

const GOOGLE_ANALYTICS_ID = 'G-D1QGEV3B07';

const coinbaseDisplay = localFont({
src: [
{
Expand Down Expand Up @@ -88,6 +90,22 @@ export default async function RootLayout({ children }: { children: React.ReactNo
name="google-site-verification"
content="lqwNRCxYlFLIcX9EiKAvE4k4ZT8JGpdWgehEIPA7y1Y"
/>
<script
src={`https://www.googletagmanager.com/gtag/js?id=${GOOGLE_ANALYTICS_ID}`}
async
defer
/>
<script
id="gtag-init"
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${GOOGLE_ANALYTICS_ID}');
`,
}}
/>
</head>
<body className="flex min-h-screen flex-col">
<AppProviders>
Expand Down
2 changes: 2 additions & 0 deletions apps/web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const contentSecurityPolicy = {
walletconnectDomains,
'https://fonts.googleapis.com', // OCK styles loads google fonts via CSS
'https://fonts.gstatic.com/', // OCK styles loads google fonts via CSS
'https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com',
],
'worker-src': ["'self'", 'blob:'],
'connect-src': [
Expand Down Expand Up @@ -120,6 +121,7 @@ const contentSecurityPolicy = {
`https://${process.env.NEXT_PUBLIC_PINATA_GATEWAY_URL}`,
'https://usdc-claim-git-master-coinbase-vercel.vercel.app',
'https://eth.merkle.io', // new default viem rpc
'https://*.google-analytics.com',
],
'frame-src': ['https://p.datadoghq.com'],
'frame-ancestors': ["'self'", baseXYZDomains],
Expand Down

0 comments on commit 08f49a6

Please sign in to comment.