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 f358443 commit da05a2f
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 @@ -25,7 +25,15 @@ defmodule Reactor.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 da05a2f

Please sign in to comment.