Add search_query to internal props (#4390)

This commit is contained in:
Adrian Gruntkowski 2024-07-26 09:40:23 +02:00 committed by GitHub
parent 28cf3ff2b2
commit 590785794f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -16,7 +16,7 @@ defmodule Plausible.Props do
@max_prop_value_length 2000
def max_prop_value_length, do: @max_prop_value_length
@internal_keys ~w(url path)
@internal_keys ~w(url path search_query)
@doc """
Lists prop keys used internally.

View File

@ -269,10 +269,15 @@ defmodule Plausible.PropsTest do
name: "404",
"meta.key": ["path", "with_error"],
"meta.value": ["/i-dont-exist", "true"]
),
build(:event,
name: "WP Search Queries",
"meta.key": ["search_query", "result_count"],
"meta.value": ["something", "12"]
)
])
assert ["first_time_customer", "logged_in", "with_error"] ==
assert ["first_time_customer", "logged_in", "result_count", "with_error"] ==
site |> Plausible.Props.suggest_keys_to_allow() |> Enum.sort()
end