Skip to content

Commit 479b26c

Browse files
[#671] Remove plausible, umami, and posthog
1 parent 7258467 commit 479b26c

File tree

17 files changed

+3
-344
lines changed

17 files changed

+3
-344
lines changed

frontend/.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
PUBLIC_URL=/
2+
REACT_APP_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
3+
REACT_APP_PUBLIC_POSTHOG_KEY=phc_GGBItNncBi9Lrf8Q2Wr6sTGodzACFi4RnUd0aqIPn11

frontend/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"private": true,
55
"dependencies": {
66
"@piwikpro/react-piwik-pro": "^2.1.1",
7-
"@plausible-analytics/tracker": "^0.4.4",
87
"antd": "^5.9.3",
98
"axios": "^0.25.0",
109
"axios-mock-adapter": "^1.21.1",
@@ -15,7 +14,6 @@
1514
"html-to-image": "^1.11.11",
1615
"lodash": "^4.17.21",
1716
"pako": "^2.1.0",
18-
"posthog-js": "^1.302.2",
1917
"pullstate": "^1.23.0",
2018
"react": "^18.2.0",
2119
"react-cookie": "^6.1.1",

frontend/public/index.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@
2424
work correctly both with client-side routing and a non-root public URL.
2525
Learn how to configure a non-root public URL by running `npm run build`.
2626
-->
27-
<!-- Umami Cloudron -->
28-
<script
29-
defer
30-
src="https://analytics.cloud.akvo.org/script.js"
31-
data-website-id="831aa5ca-bb0f-486b-b03e-b6915555232e"
32-
></script>
33-
<!-- EOL Umami.is -->
3427

3528
<!-- Matomo Cloudron -->
3629
<script>

frontend/src/hooks/PlausibleTrackPageTime.js

Lines changed: 0 additions & 51 deletions
This file was deleted.

frontend/src/hooks/PostHogTrackPageTime.js

Lines changed: 0 additions & 46 deletions
This file was deleted.

frontend/src/hooks/UmamiTrackPageTime.js

Lines changed: 0 additions & 45 deletions
This file was deleted.

frontend/src/hooks/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
export { default as usePiwikTrackPageTime } from "./PiwikTrackPageTime";
22
export { default as useWindowDimensions } from "./useWindowDimensions";
33
export { default as useSignOut } from "./useSignOut";
4-
export { default as usePlausibleTrackPageTime } from "./PlausibleTrackPageTime";
5-
export { default as usePostHogTrackPageTime } from "./PostHogTrackPageTime";
6-
export { default as useUmamiTrackPageTime } from "./UmamiTrackPageTime";
74
export { default as useMatomoCaseStepAnalytics } from "./MatomoCaseStepAnalytics";
85
export { default as useMatomoPageView } from "./MatomoPageView";

frontend/src/index.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,6 @@ import reportWebVitals from "./reportWebVitals";
66
import { BrowserRouter as Router } from "react-router-dom";
77
import { ConfigProvider } from "antd";
88
import PiwikPro from "@piwikpro/react-piwik-pro";
9-
import { init } from "@plausible-analytics/tracker";
10-
import { PostHogProvider } from "posthog-js/react";
11-
12-
// PLAUSIBLE
13-
init({
14-
domain: "synchronic-sondra-saccharic.ngrok-free.dev",
15-
});
16-
17-
// POSTHOG
18-
const posthogOptions = {
19-
api_host: process.env.REACT_APP_PUBLIC_POSTHOG_HOST,
20-
defaults: "2025-11-30",
21-
};
229

2310
// PIWIK
2411
const origin = window?.location?.origin;
@@ -50,12 +37,7 @@ root.render(
5037
},
5138
}}
5239
>
53-
<PostHogProvider
54-
apiKey={process.env.REACT_APP_PUBLIC_POSTHOG_KEY}
55-
options={posthogOptions}
56-
>
57-
<App />
58-
</PostHogProvider>
40+
<App />
5941
</ConfigProvider>
6042
</Router>
6143
);

frontend/src/pages/admin/users/UserForm.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { UserState, UIState } from "../../../store";
1919
import { api } from "../../../lib";
2020
import { CustomEvent } from "@piwikpro/react-piwik-pro";
2121
import { routePath } from "../../../components/route";
22-
import posthog from "posthog-js";
2322

2423
const transformToSelectOptions = (values) => {
2524
return values.map((x) => ({
@@ -152,15 +151,6 @@ const UserForm = () => {
152151
{ dimension2: "External" }
153152
);
154153

155-
// posthog event
156-
posthog.capture("invite_external_user", {
157-
category: "User Management",
158-
action: "Invite External User",
159-
label: "New external users",
160-
count: 1,
161-
user_type: "External", // replaces dimension2
162-
});
163-
164154
// Matomo Cloudron
165155
if (window._paq) {
166156
if (window._paq) {

frontend/src/pages/cases/components/CaseSettings.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { UserState } from "../../../store";
1919
import { countryOptions, focusCommodityOptions } from "../../../store/static";
2020
import { CustomEvent } from "@piwikpro/react-piwik-pro";
2121
import { routePath } from "../../../components/route";
22-
import posthog from "posthog-js";
2322

2423
const CaseSettings = ({ open = false, handleCancel = () => {} }) => {
2524
const [form] = Form.useForm();
@@ -307,23 +306,6 @@ const CaseSettings = ({ open = false, handleCancel = () => {} }) => {
307306
}
308307
);
309308

310-
// posthog event
311-
posthog.capture("create_case_country", {
312-
category: "Case Overview",
313-
action: "Create new case",
314-
label: "External users Country wise",
315-
count: 1,
316-
country: countryValue,
317-
});
318-
319-
posthog.capture("create_case_commodity", {
320-
category: "Case Overview",
321-
action: "Create new case",
322-
label: "External users Commodity wise",
323-
count: 1,
324-
commodity: commodityValue,
325-
});
326-
327309
// Matomo custom event track
328310
if (window._paq) {
329311
// 1️⃣ Country-wise aggregation (FREE Matomo usable)

0 commit comments

Comments
 (0)