diff --git a/app/Http/Requests/Admin/Settings/BaseSettingsFormRequest.php b/app/Http/Requests/Admin/Settings/BaseSettingsFormRequest.php
index 208c15b10..05d0f9d48 100644
--- a/app/Http/Requests/Admin/Settings/BaseSettingsFormRequest.php
+++ b/app/Http/Requests/Admin/Settings/BaseSettingsFormRequest.php
@@ -19,7 +19,6 @@ class BaseSettingsFormRequest extends AdminFormRequest
'app:name' => 'required|string|max:191',
'pterodactyl:auth:2fa_required' => 'required|integer|in:0,1,2',
'app:locale' => ['required', 'string', Rule::in(array_keys($this->getAvailableLanguages()))],
- 'app:analytics' => 'nullable|string',
];
}
@@ -32,7 +31,6 @@ class BaseSettingsFormRequest extends AdminFormRequest
'app:name' => 'Company Name',
'pterodactyl:auth:2fa_required' => 'Require 2-Factor Authentication',
'app:locale' => 'Default Language',
- 'app:analytics' => 'Google Analytics',
];
}
}
diff --git a/app/Http/ViewComposers/AssetComposer.php b/app/Http/ViewComposers/AssetComposer.php
index 32ec9fb88..902c237b7 100644
--- a/app/Http/ViewComposers/AssetComposer.php
+++ b/app/Http/ViewComposers/AssetComposer.php
@@ -33,7 +33,6 @@ class AssetComposer
'enabled' => config('recaptcha.enabled', false),
'siteKey' => config('recaptcha.website_key') ?? '',
],
- 'analytics' => config('app.analytics') ?? '',
]);
}
}
diff --git a/app/Providers/SettingsServiceProvider.php b/app/Providers/SettingsServiceProvider.php
index 71fda215e..447ac3db1 100644
--- a/app/Providers/SettingsServiceProvider.php
+++ b/app/Providers/SettingsServiceProvider.php
@@ -21,7 +21,6 @@ class SettingsServiceProvider extends ServiceProvider
protected $keys = [
'app:name',
'app:locale',
- 'app:analytics',
'recaptcha:enabled',
'recaptcha:secret_key',
'recaptcha:website_key',
diff --git a/database/migrations/2022_01_25_030847_drop_google_analytics.php b/database/migrations/2022_01_25_030847_drop_google_analytics.php
new file mode 100644
index 000000000..5daf0bc39
--- /dev/null
+++ b/database/migrations/2022_01_25_030847_drop_google_analytics.php
@@ -0,0 +1,31 @@
+where('key', 'settings::app:analytics')->delete();
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ DB::table('settings')->insert(
+ [
+ 'key' => 'settings::app:analytics',
+ ]
+ );
+ }
+}
diff --git a/package.json b/package.json
index 1a4414095..77db3475d 100644
--- a/package.json
+++ b/package.json
@@ -24,7 +24,6 @@
"react-copy-to-clipboard": "^5.0.2",
"react-dom": "npm:@hot-loader/react-dom",
"react-fast-compare": "^3.2.0",
- "react-ga": "^3.1.2",
"react-google-recaptcha": "^2.0.1",
"react-hot-loader": "^4.12.21",
"react-i18next": "^11.2.1",
diff --git a/resources/scripts/components/App.tsx b/resources/scripts/components/App.tsx
index d733538b0..1746fb6bf 100644
--- a/resources/scripts/components/App.tsx
+++ b/resources/scripts/components/App.tsx
@@ -1,7 +1,6 @@
-import React, { useEffect } from 'react';
-import ReactGA from 'react-ga';
+import React from 'react';
import { hot } from 'react-hot-loader/root';
-import { Route, Router, Switch, useLocation } from 'react-router-dom';
+import { Route, Router, Switch } from 'react-router-dom';
import { StoreProvider } from 'easy-peasy';
import { store } from '@/state';
import DashboardRouter from '@/routers/DashboardRouter';
@@ -33,16 +32,6 @@ interface ExtendedWindow extends Window {
setupInterceptors(history);
-const Pageview = () => {
- const { pathname } = useLocation();
-
- useEffect(() => {
- ReactGA.pageview(pathname);
- }, [ pathname ]);
-
- return null;
-};
-
const App = () => {
const { PterodactylUser, SiteConfiguration } = (window as ExtendedWindow);
if (PterodactylUser && !store.getState().user.data) {
@@ -62,12 +51,6 @@ const App = () => {
store.getActions().settings.setSettings(SiteConfiguration!);
}
- useEffect(() => {
- if (SiteConfiguration?.analytics) {
- ReactGA.initialize(SiteConfiguration!.analytics);
- }
- }, []);
-
return (
<>
This is the name that is used throughout the panel and in emails sent to clients.
This is your Google Analytics Tracking ID, Ex. UA-123723645-2
-