chore: only gather analytics on hexdocs.pm

This commit is contained in:
Zach Daniel 2023-10-02 10:55:20 -04:00
parent 84a3bcf37b
commit 9d934e5d7c

View file

@ -97,11 +97,12 @@ defmodule Ash.MixProject do
if type == :html do if type == :html do
""" """
<script> <script>
if (location.hostname === "hexdocs") { if (location.hostname === "hexdocs.pm") {
var script = document.createElement("script"); var script = document.createElement("script");
script.src = "https://plausible.io/js/script.js"; script.src = "https://plausible.io/js/script.js";
script.setAttribute("defer", "defer") script.setAttribute("defer", "defer")
script.setAttribute("data-domain", "ashhexdocs") script.setAttribute("data-domain", "ashhexdocs")
document.head.appendChild(script);
} }
</script> </script>
""" """