Skip to main content

Overview

Scalar allows you to inject custom JavaScript code into your API documentation through the Customize panel. You can add the CustomerOS tracker to the <head> section of your documentation.

Installation

Get the HTML Snippet from the CustomerOS app to add to your website. It is specific to your domain so that you aren’t blocked by adblockers and privacy modes.

Adding the Tracker Script

  1. Open your Scalar documentation project
  2. In the top right corner, click Customize
  3. Click on the Code tab
  4. In the “In <head> section, paste the CustomerOS tracker script
  5. Click Save or Publish your documentation
The tracker will now be included on all pages of your documentation.
The script should be placed in the “In <head>” section, not in the “After </body>” section.

Verifying Installation

After publishing your documentation:
  1. Visit your Scalar documentation site
  2. Open your browser’s developer console (F12 or right-click → Inspect)
  3. Check the Network tab for a request to your tracker domain
  4. Look for successful 200s and 202s from the tracker subdomain
  5. Check the Console tab for any errors
You should see page views appearing in your CustomerOS dashboard within a few minutes.

Troubleshooting

If the tracker isn’t working:
  • Ensure you’ve published your documentation (the tracker won’t work in preview mode)
  • Check that your tracker domain is correct and accessible
  • Verify that the script is in the “In <head> section
  • Check the browser console for any JavaScript errors
For more help, see our Troubleshooting guide.

Additional Resources

I