Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Stop listing UA views in Google data import flow (#4309)
Adrian Gruntkowski2f2602e316d9
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 75f271eeb9..747f7cfe35 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.### Removed- Deprecate `ECTO_IPV6` and `ECTO_CH_IPV6` env vars in CE plausible/analytics#4245+- Remove support for importing data from no longer available Universal Analytics### Changeddiff --git a/lib/plausible/google/api.ex b/lib/plausible/google/api.exindex 763981aea9..243f6ddfb8 100644--- a/lib/plausible/google/api.ex+++ b/lib/plausible/google/api.ex@@ -32,10 +32,7 @@ defmodule Plausible.Google.API doenddef list_properties_and_views(access_token) do- with {:ok, properties} <- Plausible.Google.GA4.API.list_properties(access_token),- {:ok, views} <- Plausible.Google.UA.API.list_views(access_token) do- {:ok, properties ++ views}- end+ Plausible.Google.GA4.API.list_properties(access_token)enddef get_property_or_view(access_token, property_or_view) dodiff --git a/test/plausible_web/controllers/google_analytics_controller_test.exs b/test/plausible_web/controllers/google_analytics_controller_test.exsindex b6a7cc224a..904382c078 100644--- a/test/plausible_web/controllers/google_analytics_controller_test.exs+++ b/test/plausible_web/controllers/google_analytics_controller_test.exs@@ -44,7 +44,7 @@ defmodule PlausibleWeb.GoogleAnalyticsControllerTest dodescribe "GET /:website/import/google-analytics/property-or-view" dosetup [:create_user, :log_in, :create_new_site]- test "lists Google Analytics views and properties", %{conn: conn, site: site} do+ test "lists Google Analytics properties WITHOUT UA views", %{conn: conn, site: site} doexpect(Plausible.HTTPClient.Mock,:get,@@ -54,15 +54,6 @@ defmodule PlausibleWeb.GoogleAnalyticsControllerTest doend)- expect(- Plausible.HTTPClient.Mock,- :get,- fn _url, _opts ->- body = "fixture/ga_list_views.json" |> File.read!() |> Jason.decode!()- {:ok, %Finch.Response{body: body, status: 200}}- end- )-response =conn|> get("/#{site.domain}/import/google-analytics/property-or-view", %{@@ -72,8 +63,8 @@ defmodule PlausibleWeb.GoogleAnalyticsControllerTest do})|> html_response(200)- assert response =~ "57238190 - one.test"- assert response =~ "54460083 - two.test"+ refute response =~ "57238190 - one.test"+ refute response =~ "54460083 - two.test"assert response =~ "account.one - GA4 (properties/428685906)"assert response =~ "GA4 - Flood-It! (properties/153293282)"assert response =~ "GA4 - Google Merch Shop (properties/213025502)"@@ -343,15 +334,6 @@ defmodule PlausibleWeb.GoogleAnalyticsControllerTest doend)- expect(- Plausible.HTTPClient.Mock,- :get,- fn _url, _opts ->- body = "fixture/ga_list_views.json" |> File.read!() |> Jason.decode!()- {:ok, %Finch.Response{body: body, status: 200}}- end- )-response =conn|> post("/#{site.domain}/import/google-analytics/property-or-view", %{@@ -392,15 +374,6 @@ defmodule PlausibleWeb.GoogleAnalyticsControllerTest doend)- expect(- Plausible.HTTPClient.Mock,- :get,- fn _url, _opts ->- body = "fixture/ga_list_views.json" |> File.read!() |> Jason.decode!()- {:ok, %Finch.Response{body: body, status: 200}}- end- )-response =conn|> post("/#{site.domain}/import/google-analytics/property-or-view", %{