Custom Events are not tracked by default - you have to configure them on your site to be sent to Plausible. See examples and learn more in <.styled_link
@@ -401,6 +407,8 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
/>
+ <.custom_property_section suffix={@suffix} />
+
<%= if ee?() and Plausible.Sites.regular?(@site) and not editing_non_revenue_goal?(assigns) do %>
<.revenue_goal_settings
f={@f}
@@ -419,6 +427,43 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
"""
end
+ attr(:suffix, :string, required: true)
+
+ def custom_property_section(assigns) do
+ ~H"""
+
+
+ Add custom property
+
+ <.toggle_switch
+ id="add-custom-property"
+ id_suffix={@suffix}
+ js_active_var="addCustomProperty"
+ />
+
+
+
+ <.live_component
+ id={"property_input_#{@suffix}"}
+ submit_name="goal[property]"
+ placeholder="Select property"
+ module={ComboBox}
+ suggest_fun={fn _input, _options -> [] end}
+ creatable
+ />
+ is
+ <.live_component
+ id={"value_input_#{@suffix}"}
+ submit_name="goal[value]"
+ placeholder="Select value"
+ module={ComboBox}
+ suggest_fun={fn _input, _options -> [] end}
+ creatable
+ />
+
+ """
+ end
+
def revenue_goal_settings(assigns) do
js_data =
Jason.encode!(%{
@@ -431,7 +476,7 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
~H"""
<%= if is_nil(@goal) do %>
-
+
<.revenue_toggle {assigns} />
<% else %>
@@ -552,15 +597,9 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
/>.
-
-
+
Enable revenue tracking
+
"""