improvement: WIP, add analytics

This commit is contained in:
Zach Daniel 2022-08-30 13:26:22 -06:00
parent fa68f3e819
commit 8289f3292c
3 changed files with 5 additions and 1 deletions

View file

@ -264,7 +264,6 @@ window.addEventListener("phx:close-search", (event) => {
// connect if there are any LiveViews on the page
liveSocket.connect()
// expose liveSocket on window for web console debug logs and latency simulation:
liveSocket.disableDebug()
// >> liveSocket.enableLatencySim(1000) // enabled for duration of browser session

View file

@ -16,6 +16,8 @@ config :ash_hq, AshHqWeb.Endpoint,
# Do not print debug messages in production
config :logger, level: :info
config :ash_hq, :analytics?, true
# ## SSL Support
#
# To get SSL working, you will need to add the `https` key

View file

@ -6,6 +6,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<%= csrf_meta_tag() %>
<%= live_title_tag assigns[:page_title] || "Ash Framework" %>
<%= if Application.get_env(:ash_hq, :analytics?) do %>
<script defer data-domain="ash-hq.org" src="https://plausible.io/js/plausible.js"></script>
<% end %>
<link phx-track-static rel="stylesheet" href="<%= Routes.static_path(@conn, "/assets/app.css") %>"/>
<script>
const configuredThemeRow = document.cookie