Skip to content

Commit

Permalink
GA: fix inline-script CSP issue (#1358)
Browse files Browse the repository at this point in the history
Fixes #1353
  • Loading branch information
tom2drum authored Nov 15, 2023
1 parent d3f3eaa commit 496858d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nextjs/csp/policies/googleAnalytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function googleAnalytics(): CspDev.DirectiveDescriptor {
],
'script-src': [
// inline script hash, see ui/shared/GoogleAnalytics.tsx
'\'sha256-NTmEg2dBnojQfTYrYJEmp3nG7V66756qPbQMCIBrctk=\'',
'\'sha256-WXRwCtfSfMoCPzPUIOUAosSaADdGgct0/Lhmnbm7MCA=\'',
'https://www.googletagmanager.com',
'*.google-analytics.com',
'*.analytics.google.com',
Expand Down
2 changes: 1 addition & 1 deletion ui/shared/GoogleAnalytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const GoogleAnalytics = () => {
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${ id }');
gtag('config', window.__envs.NEXT_PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID);
` }
</Script>
</>
Expand Down

0 comments on commit 496858d

Please sign in to comment.