Skip to content

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

Show custom event goal form by default

Uku Tahtde17154f58f3
diff --git a/lib/plausible_web/templates/site/new_goal.html.eex b/lib/plausible_web/templates/site/new_goal.html.eex
index 32d7005014..70d35fba83 100644
--- a/lib/plausible_web/templates/site/new_goal.html.eex
+++ b/lib/plausible_web/templates/site/new_goal.html.eex
@@ -2,20 +2,20 @@
<h2 class="text-xl font-black dark:text-gray-100">Add goal for <%= @site.domain %></h2>
<div class="mt-6 text-sm font-bold dark:text-gray-100">Goal trigger</div>
<div class="my-3 w-full flex rounded border border-gray-300 dark:border-gray-500">
- <div class="w-1/2 text-center py-2 border-r border-gray-300 dark:border-gray-500 shadow-inner font-bold cursor-pointer text-white dark:text-gray-100 bg-indigo-600" id="pageview-tab">Pageview</div>
- <div class="w-1/2 text-center py-2 cursor-pointer dark:text-gray-100" id="event-tab">Custom event</div>
+ <div class="w-1/2 text-center py-2 border-r border-gray-300 dark:border-gray-500 shadow-inner font-bold cursor-pointer text-white dark:text-gray-100 bg-indigo-600" id="event-tab">Custom event</div>
+ <div class="w-1/2 text-center py-2 cursor-pointer dark:text-gray-100" id="pageview-tab">Pageview</div>
</div>
<div class="my-6">
- <div id="pageview-fields">
- <%= label f, :page_path, class: "block text-sm font-bold dark:text-gray-100" %>
- <%= text_input f, :page_path, class: "transition mt-3 bg-gray-100 dark:bg-gray-900 outline-none appearance-none border border-transparent rounded w-full p-2 text-gray-700 dark:text-gray-300 leading-normal focus:outline-none focus:bg-white dark:focus:bg-gray-800 focus:border-gray-300 dark:focus:border-gray-500", placeholder: "/success" %>
- <%= error_tag f, :page_path %>
- </div>
- <div id="event-fields" class="hidden">
+ <div id="event-fields">
<%= label f, :event_name, class: "block text-sm font-bold dark:text-gray-100" %>
<%= text_input f, :event_name, class: "transition mt-3 bg-gray-100 dark:bg-gray-900 outline-none appearance-none border border-transparent rounded w-full p-2 text-gray-700 dark:text-gray-300 leading-normal focus:outline-none focus:bg-white dark:focus:bg-gray-800 focus:border-gray-300 dark:focus:border-gray-500", placeholder: "Signup" %>
<%= error_tag f, :event_name %>
</div>
+ <div id="pageview-fields" class="hidden">
+ <%= label f, :page_path, class: "block text-sm font-bold dark:text-gray-100" %>
+ <%= text_input f, :page_path, class: "transition mt-3 bg-gray-100 dark:bg-gray-900 outline-none appearance-none border border-transparent rounded w-full p-2 text-gray-700 dark:text-gray-300 leading-normal focus:outline-none focus:bg-white dark:focus:bg-gray-800 focus:border-gray-300 dark:focus:border-gray-500", placeholder: "/success" %>
+ <%= error_tag f, :page_path %>
+ </div>
</div>
<%= submit "Add goal →", class: "button mt-4 w-full" %>