mirror of
https://github.com/plausible/analytics.git
synced 2024-12-31 21:42:55 +03:00
Stop importing page referrer from GA4 (#4012)
* Stop importing page referrer from GA4 * Update GA4 import fixture * Update fixture-based test
This commit is contained in:
parent
350d42fb95
commit
c07f00636d
File diff suppressed because it is too large
Load Diff
@ -46,8 +46,7 @@ defmodule Plausible.Google.GA4.ReportRequest do
|
||||
"sessionMedium",
|
||||
"sessionCampaignName",
|
||||
"sessionManualAdContent",
|
||||
"sessionGoogleAdsKeyword",
|
||||
"pageReferrer"
|
||||
"sessionGoogleAdsKeyword"
|
||||
],
|
||||
metrics: [
|
||||
"screenPageViews",
|
||||
|
@ -96,19 +96,12 @@ defmodule Plausible.Imported.GoogleAnalytics4 do
|
||||
end
|
||||
|
||||
defp new_from_report(site_id, import_id, "imported_sources", row) do
|
||||
referrer_uri = row.dimensions |> Map.fetch!("pageReferrer") |> URI.parse()
|
||||
|
||||
referrer =
|
||||
if PlausibleWeb.RefInspector.right_uri?(referrer_uri) do
|
||||
PlausibleWeb.RefInspector.format_referrer(referrer_uri)
|
||||
end
|
||||
|
||||
%{
|
||||
site_id: site_id,
|
||||
import_id: import_id,
|
||||
date: get_date(row),
|
||||
source: row.dimensions |> Map.fetch!("sessionSource") |> parse_referrer(),
|
||||
referrer: referrer,
|
||||
referrer: nil,
|
||||
# Only `source` exists in GA4 API
|
||||
utm_source: nil,
|
||||
utm_medium: row.dimensions |> Map.fetch!("sessionMedium") |> default_if_missing(),
|
||||
|
@ -82,7 +82,7 @@ defmodule Plausible.Imported.GoogleAnalytics4Test do
|
||||
Enum.each(Plausible.Imported.tables(), fn table ->
|
||||
count =
|
||||
case table do
|
||||
"imported_sources" -> 1090
|
||||
"imported_sources" -> 210
|
||||
"imported_visitors" -> 31
|
||||
"imported_pages" -> 3340
|
||||
"imported_entry_pages" -> 2934
|
||||
|
Loading…
Reference in New Issue
Block a user