Skip to content

Commit e8ec3d3

Browse files
authored
fix(csp): allow GA via Tag Manager (#10715)
1 parent 58ac9dd commit e8ec3d3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: libs/constants/index.js

+14
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ export const CSP_SCRIPT_SRC_VALUES = [
6464
"'report-sample'",
6565
"'self'",
6666

67+
// UA.
6768
"www.google-analytics.com/analytics.js",
69+
// GA4.
70+
"https://www.googletagmanager.com/gtag/js",
6871

6972
"assets.codepen.io",
7073
"production-assets.codepen.io",
@@ -104,7 +107,12 @@ export const CSP_DIRECTIVES = {
104107
"updates.developer.allizom.org",
105108
"updates.developer.mozilla.org",
106109

110+
// UA.
107111
"www.google-analytics.com",
112+
// GA4.
113+
"https://*.google-analytics.com",
114+
"https://*.googletagmanager.com",
115+
108116
"stats.g.doubleclick.net",
109117
"https://api.stripe.com",
110118
],
@@ -146,7 +154,13 @@ export const CSP_DIRECTIVES = {
146154
"wikipedia.org",
147155
"upload.wikimedia.org",
148156

157+
// UA.
149158
"www.google-analytics.com",
159+
160+
// GA4.
161+
"https://*.google-analytics.com",
162+
"https://*.googletagmanager.com",
163+
150164
"www.gstatic.com",
151165
],
152166
"manifest-src": ["'self'"],

0 commit comments

Comments
 (0)