I use Plausible Analytics for web analytics. Here’s a method that seems to work for enabling Plausible on an Obsidian Publish site with a custom domain.
Plausible asks you to insert the following snippet in the
<head> tag of your website:
<script defer data-domain="yourdomain.com" src="https://plausible.io/js/script.js"></script>
<head> tag as required.
var plausibleSnippet = document.createElement('script'); plausibleSnippet.defer = true; plausibleSnippet.setAttribute('data-domain', 'yourdomain.com'); plausibleSnippet.src = 'https://plausible.io/js/plausible.js'; document.head.appendChild(plausibleSnippet);
yourdomain.com with your site’s domain name, and (re-)publishing the
publish.js file. Happy analyzing!