diff --git a/studio/.env.local.example b/studio/.env.local.example index 715ab5441f..c3d0643eba 100644 --- a/studio/.env.local.example +++ b/studio/.env.local.example @@ -17,6 +17,10 @@ NEXT_PUBLIC_SENTRY_CLIENT_REPLAYS_SESSION_SAMPLE_RATE= # edge config NEXT_PUBLIC_SENTRY_EDGE_SAMPLE_RATE= +# analytics config +NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID= +NEXT_PUBLIC_LINKEDIN_INSIGHT_ID= + # used by https://docs.sentry.io/platforms/javascript/guides/nextjs/ # enable this during build to enable sentry support for custom images # when using debug, ensure the image was build with SENTRY_DEBUG="true" diff --git a/studio/next.config.mjs b/studio/next.config.mjs index 7101721a64..0ddbd8c7ce 100644 --- a/studio/next.config.mjs +++ b/studio/next.config.mjs @@ -57,16 +57,16 @@ const lightweightCspHeader = ` frame-src 'self' https://js.stripe.com https://hooks.stripe.com ${ isPreview ? "https://vercel.live/ https://vercel.com" : "" }; - img-src 'self' ${ + img-src 'self'${ isPreview - ? "https://vercel.live/ https://vercel.com *.pusher.com/ data: blob:" + ? " https://vercel.live/ https://vercel.com *.pusher.com/ data: blob:" : "" - }; + } *.ads.linkedin.com; script-src 'report-sample' 'self' 'unsafe-inline' ${ allowUnsafeEval ? "'unsafe-eval'" : "" - } https://*.wundergraph.com https://js.stripe.com https://maps.googleapis.com https://plausible.io https://wundergraph.com https://static.reo.dev ${ - isPreview ? "https://vercel.live https://vercel.com" : "" - }; + } https://*.wundergraph.com https://js.stripe.com https://maps.googleapis.com https://plausible.io https://wundergraph.com https://static.reo.dev${ + isPreview ? " https://vercel.live https://vercel.com" : "" + } https://www.googletagmanager.com https://snap.licdn.com; manifest-src 'self'; media-src 'self'; worker-src 'self' ${isSentryFeatureReplayEnabled ? "blob:" : ""}; diff --git a/studio/src/pages/_document.tsx b/studio/src/pages/_document.tsx index 27b5597b67..dd6dd1c24b 100644 --- a/studio/src/pages/_document.tsx +++ b/studio/src/pages/_document.tsx @@ -15,10 +15,27 @@ const getCustomScripts = (): export default function Document() { const scripts = getCustomScripts(); + const gtmId = process.env.NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID; + const linkedInInsightId = process.env.NEXT_PUBLIC_LINKEDIN_INSIGHT_ID; return ( + {gtmId && ( +