Skip to content

Commit

Permalink
chore: only track analytics on hexdocs.pm
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Oct 2, 2023
1 parent 326b4e6 commit 7d4077f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,15 @@ defmodule AshDoubleEntry.MixProject do
before_closing_head_tag: fn type ->
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,
Expand Down

0 comments on commit 7d4077f

Please sign in to comment.