mirror of
https://github.com/plausible/analytics.git
synced 2024-12-24 10:02:10 +03:00
Change custom domain javascript filename to index.js
This commit is contained in:
parent
36c08b989d
commit
7fae8b9606
@ -14,10 +14,14 @@ defmodule PlausibleWeb.SiteView do
|
||||
end
|
||||
|
||||
def snippet(site) do
|
||||
tracker_domain = if site.custom_domain, do: site.custom_domain.domain, else: "plausible.io"
|
||||
tracker = if site.custom_domain do
|
||||
"https://" <> site.custom_domain.domain <> "/js/index.js"
|
||||
else
|
||||
"https://plausible.io/js/plausible.js"
|
||||
end
|
||||
|
||||
"""
|
||||
<script async defer data-domain="#{site.domain}" src="https://#{tracker_domain}/js/plausible.js"></script>
|
||||
<script async defer data-domain="#{site.domain}" src="#{tracker}"></script>
|
||||
"""
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user