FEATURE: Upgrade analytics.js to gtag.js (#10893)

Per Google, sites are encouraged to upgrade from `analytics.js` to `gtag.js` for Google Analytics tracking. This commit updates core Discourse to use the new `gtag.js` API Google is asking sites to use. This API has feature parity with `analytics.js` but does not use trackers.
This commit is contained in:
Justin DiRose
2020-10-13 11:24:06 -05:00
committed by GitHub
parent 46d1c91e1a
commit f4034226c2
5 changed files with 22 additions and 18 deletions

View File

@@ -74,7 +74,7 @@ describe ContentSecurityPolicy do
SiteSetting.gtm_container_id = 'GTM-ABCDEF'
script_srcs = parse(policy)['script-src']
expect(script_srcs).to include('https://www.google-analytics.com/analytics.js')
expect(script_srcs).to include('https://www.googletagmanager.com/gtag/js')
expect(script_srcs).to include('https://www.googletagmanager.com/gtm.js')
end