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 ( <> @@ -76,7 +59,6 @@ const App = () => {
- {SiteConfiguration?.analytics && } diff --git a/resources/scripts/state/settings.ts b/resources/scripts/state/settings.ts index 3eb782d91..20dbbdc6e 100644 --- a/resources/scripts/state/settings.ts +++ b/resources/scripts/state/settings.ts @@ -7,7 +7,6 @@ export interface SiteSettings { enabled: boolean; siteKey: string; }; - analytics: string; } export interface SettingsStore { diff --git a/resources/views/admin/settings/index.blade.php b/resources/views/admin/settings/index.blade.php index 5ccec0dfa..489646dc9 100644 --- a/resources/views/admin/settings/index.blade.php +++ b/resources/views/admin/settings/index.blade.php @@ -31,13 +31,6 @@

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

-
-
diff --git a/yarn.lock b/yarn.lock index 39d42755a..9c67ff246 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6221,11 +6221,6 @@ react-fast-compare@^3.2.0: resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb" integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA== -react-ga@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/react-ga/-/react-ga-3.1.2.tgz#e13f211c51a2e5c401ea69cf094b9501fe3c51ce" - integrity sha512-OJrMqaHEHbodm+XsnjA6ISBEHTwvpFrxco65mctzl/v3CASMSLSyUkFqz9yYrPDKGBUfNQzKCjuMJwctjlWBbw== - react-google-recaptcha@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/react-google-recaptcha/-/react-google-recaptcha-2.0.1.tgz#3276b29659493f7ca2a5b7739f6c239293cdf1d8"