Skip to content

Commit

Permalink
track 404s better
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed May 3, 2024
1 parent 2f7a352 commit 817d401
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions 404.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ title: "404 Page Not Found"
Perhaps you are here due to a mis-typed URL

[Return to the homepage]({{ site.baseurl }}){:.btn.btn-primary}, or [Search]({% link search.md %}){:.btn.btn-secondary} for your page.

<script>document.addEventListener('DOMContentLoaded', function () { plausible('404', { props: { path: document.location.pathname } }); });</script>
3 changes: 2 additions & 1 deletion _includes/analytics.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@
</script>

<!-- Page view tracking -->
<script async defer data-domain="training.galaxyproject.org" src="https://plausible.galaxyproject.eu/js/plausible.js"></script>
<script defer data-domain="training.galaxyproject.org" src="https://plausible.galaxyproject.eu/js/plausible.js"></script>
<script>
if(localStorage.getItem('plausible-opt-out') !== 'opt-out' && navigator.doNotTrack !== "1") {
localStorage.removeItem("plausible_ignore")
console.log("Plausible: opt-in");
window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }
} else {
// if they're opting-out, or DNT
// we might get one page by accident but we won't get future ones.
Expand Down

0 comments on commit 817d401

Please sign in to comment.