Skip to content

Commit 0e6f609

Browse files
committed
Migrate to GA4
Universal Analytics has been shut down
1 parent d9cbb0c commit 0e6f609

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ Blaze app can now be accessed at port `8080` :tada:
140140
## Privacy and Analytics
141141
- Blaze server does not track or record the files that are being shared both by WebSockets and WebTorrent.
142142
- Any user related data like nickname, room names are always stored on device, and are only shared with the server when the user joins a room for file sharing.
143-
- Blaze client uses Google Analytics to record the following:
144-
- [Basic visit data](https://developers.google.com/analytics/devguides/collection/analyticsjs#what_data_does_the_google_analytics_tag_capture) as recorded by [Google Analytics](https://support.google.com/analytics/answer/6004245?ref_topic=2919631)
143+
- Blaze client uses Google Analytics 4 to record the following:
144+
- Part of [Basic visit data](https://support.google.com/analytics/answer/9234069?hl=en) - page views, scrolls and outbound clicks, rest are disabled.
145145
- If Blaze PWA is installed on the device, and whether files are shared using share targets.
146146

147147
## Contributing

client/src/routes/App/layouts/AppLanding/AppLanding.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { h } from 'preact';
22
import { memo } from 'preact/compat';
3-
import { ArrowDownCircle, Gift, Grid, PieChart, Settings } from 'preact-feather';
3+
import { ArrowDownCircle, Gift, Grid, Settings } from 'preact-feather';
44
import { Link } from 'preact-router/match';
55
import { useContext } from 'preact/hooks';
66
import { PWAInstall } from '../../contexts/PWAInstall';
@@ -36,9 +36,7 @@ function AppLanding({ children, title, subtitle }) {
3636
deferredPrompt.prompt();
3737
const { outcome } = await deferredPrompt.userChoice;
3838

39-
window.ga('send', 'event', {
40-
eventCategory: 'pwa-install',
41-
eventAction: 'promo-shown',
39+
window.gtag('event', 'pwa-install-prompt', {
4240
outcome,
4341
});
4442
};

client/src/template.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@
3535
<meta name="msapplication-TileColor" content="#0D1322" />
3636
<meta name="msapplication-TileImage" content="/assets/images/mstile-144x144.png" />
3737

38+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-K0HSN5M77L"></script>
3839
<script>
39-
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
40-
ga('create', 'UA-82138003-3', 'auto');
41-
ga('set', 'transport', 'beacon');
42-
ga('send', 'pageview');
40+
window.dataLayer = window.dataLayer || [];
41+
function gtag(){dataLayer.push(arguments);}
42+
gtag('js', new Date());
43+
gtag('config', 'G-K0HSN5M77L');
4344
</script>
44-
<script async src='https://www.google-analytics.com/analytics.js'></script>
4545

4646

4747
<% preact.headEnd %>

0 commit comments

Comments
 (0)