Skip to content

Commit

Permalink
fix(csp): allow GA via Tag Manager (#10715)
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner authored Mar 15, 2024
1 parent 58ac9dd commit e8ec3d3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions libs/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ export const CSP_SCRIPT_SRC_VALUES = [
"'report-sample'",
"'self'",

// UA.
"www.google-analytics.com/analytics.js",
// GA4.
"https://www.googletagmanager.com/gtag/js",

"assets.codepen.io",
"production-assets.codepen.io",
Expand Down Expand Up @@ -104,7 +107,12 @@ export const CSP_DIRECTIVES = {
"updates.developer.allizom.org",
"updates.developer.mozilla.org",

// UA.
"www.google-analytics.com",
// GA4.
"https://*.google-analytics.com",
"https://*.googletagmanager.com",

"stats.g.doubleclick.net",
"https://api.stripe.com",
],
Expand Down Expand Up @@ -146,7 +154,13 @@ export const CSP_DIRECTIVES = {
"wikipedia.org",
"upload.wikimedia.org",

// UA.
"www.google-analytics.com",

// GA4.
"https://*.google-analytics.com",
"https://*.googletagmanager.com",

"www.gstatic.com",
],
"manifest-src": ["'self'"],
Expand Down

0 comments on commit e8ec3d3

Please sign in to comment.