Skip to content

Commit

Permalink
chore: only gather 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 bbc22d3 commit eab7619
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 @@ -107,7 +107,15 @@ defmodule AshPhoenix.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 eab7619

Please sign in to comment.