chore: only track analytics on hexdocs.pm

This commit is contained in:
Zach Daniel 2023-10-02 11:09:13 -04:00
parent dba7216970
commit 823cab1658

10
mix.exs
View file

@ -89,7 +89,15 @@ defmodule AshArchival.MixProject do
before_closing_head_tag: fn type -> before_closing_head_tag: fn type ->
if type == :html do if type == :html do
""" """
<script defer data-domain="ashhexdocs" src="https://plausible.io/js/script.js"></script> <script>
if (location.hostname === "hexdocs.pm") {
var script = document.createElement("script");
script.src = "https://plausible.io/js/script.js";
script.setAttribute("defer", "defer")
script.setAttribute("data-domain", "ashhexdocs")
document.head.appendChild(script);
}
</script>
""" """
end end
end, end,