Bump GA4 import page limit to max 250k (#4045)

* Bump GA4 page limit to 250k

* Handle empty properties list response gracefully
This commit is contained in:
Adrian Gruntkowski 2024-04-26 20:41:42 +02:00 committed by GitHub
parent 805b5acbc7
commit ca25b6c764
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View File

@ -14,7 +14,7 @@ defmodule Plausible.Google.GA4.API do
expires_at :: String.t()
}
@per_page 50_000
@per_page 250_000
@backoff_factor :timer.seconds(10)
@max_attempts 5
@ -37,6 +37,9 @@ defmodule Plausible.Google.GA4.API do
{:ok, accounts}
{:ok, _} ->
{:ok, []}
{:error, cause} ->
{:error, cause}
end

View File

@ -27,6 +27,14 @@ defmodule Plausible.Google.GA4.APITest do
]}
] = accounts
end
test "handles empty response properly" do
expect(Plausible.HTTPClient.Mock, :get, fn _url, _opts ->
{:ok, %Finch.Response{status: 200, body: %{}}}
end)
assert {:ok, []} = GA4.API.list_properties("some_access_token")
end
end
describe "get_property/2" do