Add Fathom Analytics to your Obsidian Publish site

Today I figured out how to embed the tracking code for Fathom Analytics into an Obsidian Publish website. It's easy.

  1. Create a file in the root of your Obsidian Vault called publish.js - You'll need to use an editor like VS Code for this as Obsidian won't handle it.
  2. Add this code to that file, replacing <your-site-code> with your actual site code.
  1. Use Obsidian to publish the publish.js file just like any other file.

That's it!