Commit 496858d8 authored by tom goriunov's avatar tom goriunov Committed by GitHub

GA: fix inline-script CSP issue (#1358)

Fixes #1353
parent d3f3eaa7
...@@ -16,7 +16,7 @@ export function googleAnalytics(): CspDev.DirectiveDescriptor { ...@@ -16,7 +16,7 @@ export function googleAnalytics(): CspDev.DirectiveDescriptor {
], ],
'script-src': [ 'script-src': [
// inline script hash, see ui/shared/GoogleAnalytics.tsx // inline script hash, see ui/shared/GoogleAnalytics.tsx
'\'sha256-NTmEg2dBnojQfTYrYJEmp3nG7V66756qPbQMCIBrctk=\'', '\'sha256-WXRwCtfSfMoCPzPUIOUAosSaADdGgct0/Lhmnbm7MCA=\'',
'https://www.googletagmanager.com', 'https://www.googletagmanager.com',
'*.google-analytics.com', '*.google-analytics.com',
'*.analytics.google.com', '*.analytics.google.com',
......
...@@ -20,7 +20,7 @@ const GoogleAnalytics = () => { ...@@ -20,7 +20,7 @@ const GoogleAnalytics = () => {
window.dataLayer = window.dataLayer || []; window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);} function gtag(){dataLayer.push(arguments);}
gtag('js', new Date()); gtag('js', new Date());
gtag('config', '${ id }'); gtag('config', window.__envs.NEXT_PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID);
` } ` }
</Script> </Script>
</> </>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment