Add 404 page tracking

This commit is contained in:
Oliver Davies 2021-06-30 08:00:00 +01:00
parent 6b0f7d59d5
commit d252bd0a2c
3 changed files with 10 additions and 0 deletions

View file

@ -13,5 +13,6 @@
</head> </head>
<body> <body>
{% block body %}{% endblock %} {% block body %}{% endblock %}
{% block javascripts %}{% endblock %}
</body> </body>
</html> </html>

8
source/_pages/404.html Normal file
View file

@ -0,0 +1,8 @@
---
title: Page not found
permalink: /404.html
---
{% block javascripts %}
<script>plausible("404",{ props: { path: document.location.pathname } });</script>
{% endblock %}

View file

@ -1,3 +1,4 @@
{% if plausible.domain %} {% if plausible.domain %}
<script defer data-domain="{{ plausible.domain }}" src="https://plausible.io/js/plausible.js"></script> <script defer data-domain="{{ plausible.domain }}" src="https://plausible.io/js/plausible.js"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
{% endif %} {% endif %}