mirror of
https://github.com/plausible/analytics.git
synced 2024-12-27 03:21:37 +03:00
d6824de1ad
* Rename internal build symbols * Rename remaining + add `on_ce` macro cc @ruslandoga
30 lines
1014 B
Plaintext
30 lines
1014 B
Plaintext
<%= on_ee do %>
|
|
<%= if !@conn.assigns[:skip_plausible_tracking] do %>
|
|
<script
|
|
defer
|
|
data-api={PlausibleWeb.Dogfood.api_destination()}
|
|
data-domain={PlausibleWeb.Dogfood.domain(@conn)}
|
|
src={PlausibleWeb.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: <%= is_map(@conn.assigns[:current_user]) %>,
|
|
theme: '<%= if @conn.assigns[:current_user], do: @conn.assigns[:current_user].theme, else: "system" %>',
|
|
browser_language: navigator.language || navigator.userLanguage
|
|
}
|
|
})
|
|
</script>
|
|
<% end %>
|
|
<% end %>
|