Obsidian Publish allows adding JavaScript, which means you can add a Plausible Analytics tracking code to your site.
Configure Plausible Analytics
- Create your Obsidian Publish site in your Plausible Analytics account.
- Grab your tracking code.
Configure Obsidian Publish
- Create a file named publish.js in the root of your Obsidian vault. Create this file from file explorer, not from within Obsidian!
- Copy the below script to the publish.js file.
- Update the
data-domain
andsrc
to the values provided in the Plausible script. - Save and publish the publish.js file to your Obsidian Publish site!
- Open your Plausible Analytics page and refresh your Obsidian Publish page. Plausible Analytics should recognize an active visitor to the site.
var analyticsScript = document.createElement('script');
analyticsScript.defer = true;
analyticsScript.data-domain = "yourdomain.com";
analyticsScript.src = '[plausible.io/js/script...(https://plausible.io/js/script.js';)
document.head.appendChild(analyticsScript);