Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Log warning when m/meta parameter used in ingestion (#5478)

Karl-Aksel Puulmannd4bec6d9e3e7
diff --git a/lib/plausible/ingestion/request.ex b/lib/plausible/ingestion/request.ex
index 95831febe0..efbccc5320 100644
--- a/lib/plausible/ingestion/request.ex
+++ b/lib/plausible/ingestion/request.ex
@@ -24,6 +24,7 @@ defmodule Plausible.Ingestion.Request do
use Ecto.Schema
use Plausible
+ require Logger
alias Ecto.Changeset
@max_url_size 2_000
@@ -230,6 +231,13 @@ defmodule Plausible.Ingestion.Request do
|> Enum.take(@max_props)
|> Map.new()
+ # Temporary instrumentation to see if `m`/`meta` field was used.
+ if request_body["m"] || request_body["meta"] do
+ Logger.warning(
+ "Ingestion: request body contains meta field. domain=#{request_body["d"] || request_body["domain"]}"
+ )
+ end
+
changeset
|> Changeset.put_change(:props, props)
|> validate_props()