Skip to main content
Support home / Integrations

Wix

Fathom Analytics works with Wix websites. Here's how to add the Fathom script to your Wix site.

Adding the Fathom script

Note: Adding custom code requires a Wix Premium plan.

  1. Log in to your Wix account and go to your site's dashboard
  2. Click on Settings in the left sidebar
  3. Scroll down and click on Custom Code (under "Advanced")
  4. Click + Add Custom Code
  5. Paste your Fathom Analytics script:
<script src="https://cdn.usefathom.com/script.js" data-site="YOUR-SITE-ID" defer></script>

Note: Replace `YOUR-SITE-ID` with your actual Fathom site ID. You can find this in your Fathom site settings.

  1. Give it a name like "Fathom Analytics"
  2. Under Add Code to Pages, select "All pages"
  3. Under Place Code in, select "Head"
  4. Click Apply

Verifying the installation

After adding the code:

  1. Publish your site if you haven't already
  2. Visit your live site (not the Wix editor preview)
  3. Check your Fathom dashboard to see if your visit was recorded

Tracking events

To track custom events like form submissions or button clicks, you can add additional custom code snippets to specific pages:

  1. Go to SettingsCustom Code
  2. Click + Add Custom Code
  3. Add your event tracking code:
<script>
document.addEventListener('DOMContentLoaded', function() {
// Example: Track when a specific button is clicked
var button = document.querySelector('[data-testid="buttonElement"]');
if (button) {
button.addEventListener('click', function() {
fathom.trackEvent('Button Clicked');
});
}
});
</script>
  1. Choose which pages to add it to
  2. Select "Body - end" for the placement
  3. Click Apply

Tip: Wix uses dynamic class names and test IDs, so you may need to inspect your page to find the correct selectors for your elements.

Troubleshooting

If you're not seeing data in your Fathom dashboard:

  • Make sure your site is published (the editor preview won't track visits)
  • Disable any ad blockers you're using, as they may block the Fathom script
  • Check that the script was added to the "Head" section, not "Body"
  • Verify that you've replaced YOUR-SITE-ID with your actual site ID

Further customization

To learn about all the options we offer, read our advanced documentation here.


If you still have questions or require help with anything, please reach out to us and we'll happily get things sorted out for you.


Can't find what you're looking for?