After reading through the great guidance on this forum for options to enable site visitor analytics, I’ve dived headfirst into getting Plausible running and am very satisfied with my choice.
The specifics of the Plausible + Ghost combination, however, were not obvious and the installation has required some effort. I’ve found a way forward with all the essentials and am now just adding the cream.
I’m now enabling 404 error page tracking, as per https://plausible.io/docs/404-error-pages-tracking
It requires a tag be added to the site’s 404 page. In Ghost this page is generated by the error-404.hbs
file. I could add it to this file, but I’d like to avoid editing the Theme if possible (I’ve managed to make a bunch of significant customisations without resorting to modifying the Theme, so far).
Is there another way to add a small <script>
tag to the 404 page? For example, by adding something to Code Injection that checks the page is the 404 page before taking action? Or conversely, setting Plausible to detect something that is already present in Ghost 404 pages?