mirror of
https://github.com/plausible/analytics.git
synced 2024-12-29 20:42:01 +03:00
aee6f105c2
* Track funnels and custom props settings * Send dogfood script events to ingest.plausible.io * Mix format
26 lines
758 B
Plaintext
26 lines
758 B
Plaintext
<%= if !Application.get_env(:plausible, :is_selfhost) && !@conn.assigns[:skip_plausible_tracking] do %>
|
|
<script
|
|
defer
|
|
data-api={dogfood_api_destination()}
|
|
data-domain={dogfood_domain(@conn)}
|
|
src={dogfood_script_url()}
|
|
>
|
|
</script>
|
|
<script>
|
|
window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }
|
|
|
|
<%= if @conn.assigns[:dogfood_page_path] do %>
|
|
const pageUrl = '<%= Path.join(plausible_url(), @conn.assigns[:dogfood_page_path]) %>'
|
|
<% else %>
|
|
const pageUrl = window.location.href
|
|
<% end %>
|
|
|
|
plausible('pageview', {
|
|
u: pageUrl,
|
|
props: {
|
|
logged_in: <%= !!@conn.assigns[:current_user] %>
|
|
}
|
|
})
|
|
</script>
|
|
<% end %>
|