Overview
Mintlify allows you to add custom JavaScript files to your documentation site through thedocs.json configuration file. Custom scripts are included across all pages of your documentation.
Installation
Get the JavaScript snippet from the CustomerOS app - it’s specific to your domain so that you aren’t blocked by adblockers and privacy modes.-
In your Mintlify project’s root directory, create a new JavaScript file:
-
Open
customeros-tracker.jsand paste the JavaScript code from the CustomerOS app -
Update your
docs.jsonfile to include the custom script:If you already have asettingssection, just add the script to thecustomScriptsarray: -
Commit and push the files to your repository:
- Deploy your Mintlify site
The JavaScript file should be placed in the root directory of your Mintlify
project, and the path in
docs.json should start with /.Verifying Installation
After deploying your site:- Visit your Mintlify documentation
- Open your browser’s developer console (F12 or right-click → Inspect)
- Check the Network tab for a request to your tracker domain
- Look for successful 200s and 202s from the tracker subdomain
- Check the Console tab for any errors
Troubleshooting
If the tracker isn’t working:- Ensure the
.jsfile is in the root directory of your project - Check that the script path is correctly added to
docs.jsonin thesettings.customScriptsarray - Verify the path starts with
/(e.g.,/customeros-tracker.js) - Check that you’ve deployed the changes to your Mintlify site
- Verify that your tracker domain is correct and accessible
- Check the browser console for any JavaScript errors