chore: only track analytics on hexdocs

This commit is contained in:
Zach Daniel 2023-10-02 10:33:58 -04:00
parent 5aed668c68
commit 84a3bcf37b

View file

@ -96,7 +96,14 @@ defmodule Ash.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") {
var script = document.createElement("script");
script.src = "https://plausible.io/js/script.js";
script.setAttribute("defer", "defer")
script.setAttribute("data-domain", "ashhexdocs")
}
</script>
""" """
end end
end, end,