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.
- Log in to your Wix account and go to your site's dashboard
- Click on Settings in the left sidebar
- Scroll down and click on Custom Code (under "Advanced")
- Click + Add Custom Code
- 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.
- Give it a name like "Fathom Analytics"
- Under Add Code to Pages, select "All pages"
- Under Place Code in, select "Head"
- Click Apply
Verifying the installation
After adding the code:
- Publish your site if you haven't already
- Visit your live site (not the Wix editor preview)
- 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:
- Go to Settings → Custom Code
- Click + Add Custom Code
- 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>- Choose which pages to add it to
- Select "Body - end" for the placement
- 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-IDwith your actual site ID
Further customization
To learn about all the options we offer, read our advanced documentation here.