remove unused google analytics support

This commit is contained in:
Athou
2025-07-29 12:35:53 +02:00
parent 9a25157d3f
commit a8c47d717c
7 changed files with 1 additions and 36 deletions

View File

@@ -32,7 +32,6 @@
"react-device-detect": "^2.2.3",
"react-dom": "^19.1.1",
"react-draggable": "^4.5.0",
"react-ga4": "^2.1.0",
"react-icons": "^5.5.0",
"react-infinite-scroller": "^1.2.6",
"react-redux": "^9.2.0",
@@ -4950,12 +4949,6 @@
"react-dom": ">= 16.3.0"
}
},
"node_modules/react-ga4": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/react-ga4/-/react-ga4-2.1.0.tgz",
"integrity": "sha512-ZKS7PGNFqqMd3PJ6+C2Jtz/o1iU9ggiy8Y8nUeksgVuvNISbmrQtJiZNvC/TjDsqD0QlU5Wkgs7i+w9+OjHhhQ==",
"license": "MIT"
},
"node_modules/react-icons": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.5.0.tgz",

View File

@@ -39,7 +39,6 @@
"react-device-detect": "^2.2.3",
"react-dom": "^19.1.1",
"react-draggable": "^4.5.0",
"react-ga4": "^2.1.0",
"react-icons": "^5.5.0",
"react-infinite-scroller": "^1.2.6",
"react-redux": "^9.2.0",

View File

@@ -6,8 +6,7 @@ import { Notifications } from "@mantine/notifications"
import type React from "react"
import { useEffect, useState } from "react"
import { isSafari } from "react-device-detect"
import ReactGA from "react-ga4"
import { HashRouter, Navigate, Route, Routes, useLocation, useNavigate } from "react-router-dom"
import { HashRouter, Navigate, Route, Routes, useNavigate } from "react-router-dom"
import Tinycon from "tinycon"
import { Constants } from "@/app/constants"
import { redirectTo } from "@/app/redirect/slice"
@@ -125,21 +124,6 @@ function RedirectHandler() {
return null
}
function GoogleAnalyticsHandler() {
const location = useLocation()
const googleAnalyticsCode = useAppSelector(state => state.server.serverInfos?.googleAnalyticsCode)
useEffect(() => {
if (googleAnalyticsCode) ReactGA.initialize(googleAnalyticsCode)
}, [googleAnalyticsCode])
useEffect(() => {
if (ReactGA.isInitialized) ReactGA.send({ hitType: "pageview", page: location.pathname })
}, [location])
return null
}
function UnreadCountTitleHandler({ enabled }: { enabled?: boolean }) {
const root = useAppSelector(state => state.tree.rootCategory)
const unreadCount = categoryUnreadCount(root)
@@ -229,7 +213,6 @@ export function App() {
{!isSafari && <DisablePullToRefresh />}
<HashRouter>
<GoogleAnalyticsHandler />
<RedirectHandler />
<AppRoutes />
</HashRouter>

View File

@@ -214,7 +214,6 @@ export interface ServerInfo {
version: string
gitCommit: string
allowRegistrations: boolean
googleAnalyticsCode?: string
smtpEnabled: boolean
demoAccountEnabled: boolean
websocketEnabled: boolean

View File

@@ -51,11 +51,6 @@ public interface CommaFeedConfiguration {
*/
Optional<String> announcement();
/**
* Google Analytics tracking code.
*/
Optional<String> googleAnalyticsTrackingCode();
/**
* Google Auth key for fetching Youtube channel favicons.
*/

View File

@@ -25,9 +25,6 @@ public class ServerInfo implements Serializable {
@Schema(required = true)
private boolean allowRegistrations;
@Schema
private String googleAnalyticsCode;
@Schema(required = true)
private boolean smtpEnabled;

View File

@@ -51,7 +51,6 @@ public class ServerREST {
infos.setVersion(version.getVersion());
infos.setGitCommit(version.getGitCommit());
infos.setAllowRegistrations(config.users().allowRegistrations());
infos.setGoogleAnalyticsCode(config.googleAnalyticsTrackingCode().orElse(null));
infos.setSmtpEnabled(config.passwordRecoveryEnabled());
infos.setDemoAccountEnabled(config.users().createDemoAccount());
infos.setWebsocketEnabled(config.websocket().enabled());