Skip to content

Commit 322f3e2

Browse files
rviscomitunetheweb
andauthored
Upgrade to GA4 (#3403)
* GA4 * UA + GA4 + CSP updates --------- Co-authored-by: Barry Pollard <barrypollard@google.com>
1 parent a41ce39 commit 322f3e2

4 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/server/csp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"'self'",
1414
"webmention.io",
1515
"discuss.httparchive.org",
16+
"*.google-analytics.com",
1617
"www.google-analytics.com",
1718
"www.googletagmanager.com",
1819
],

src/server/search_csp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"connect-src": ["'self'", "www.google-analytics.com", "www.googletagmanager.com"],
1515
"img-src": [
1616
"'self'",
17-
"www.google-analytics.com",
17+
"*.google-analytics.com",
1818
"www.googletagmanager.com",
1919
"www.googleapis.com",
2020
"*.google.com",

src/server/stories_csp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"connect-src": [
1212
"'self'",
1313
"discuss.httparchive.org",
14-
"www.google-analytics.com",
14+
"*.google-analytics.com",
1515
"www.googletagmanager.com",
1616
"cdn.ampproject.org",
1717
],

src/templates/base.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
gtag('config', 'UA-22381566-3', {
2323
'link_attribution': true
2424
});
25+
gtag('config', 'G-PQ5N2MZG5M');
2526
</script>
2627
{% endblock %}
2728
<link rel="shortcut icon" href="/static/images/favicon.ico">
@@ -99,7 +100,7 @@
99100
{% block content %}{% endblock %}
100101

101102
{% block bodyend %}
102-
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-22381566-3" nonce="{{ csp_nonce() }}"></script>
103+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PQ5N2MZG5M" nonce="{{ csp_nonce() }}"></script>
103104
<link rel="preconnect" href="https://www.google-analytics.com">
104105
<script defer src="{{ get_versioned_filename('/static/js/web-vitals.js') }}" nonce="{{ csp_nonce() }}"></script>
105106
<script defer src="{{ get_versioned_filename('/static/js/send-web-vitals.js') }}" nonce="{{ csp_nonce() }}"></script>

0 commit comments

Comments
 (0)