> ## Documentation Index
> Fetch the complete documentation index at: https://docs.customeros.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Fern

> Install the CustomerOS tracker on your Fern documentation site

## Overview

Fern allows you to add custom JavaScript to your documentation site through the `docs.yml` configuration file. This enables you to include the CustomerOS tracker across all pages.

## 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.

1. In your Fern project, create a JavaScript file for the tracker:

   ```bash theme={"system"}
   mkdir -p fern/js
   touch fern/js/customeros-tracker.js
   ```

2. Open `fern/js/customeros-tracker.js` and paste the JavaScript code from the CustomerOS app

3. Update your `docs.yml` file to include the custom JavaScript:

   ```yaml theme={"system"}
   js:
       - path: ./js/customeros-tracker.js
   ```

4. Commit and push your changes:

   ```bash theme={"system"}
   git add fern/js/customeros-tracker.js fern/docs.yml
   git commit -m "Add CustomerOS tracker"
   git push
   ```

5. Deploy your Fern documentation

The tracker will now be included on all pages of your documentation.

<Note>
  Make sure the path in your `docs.yml` correctly points to your JavaScript
  file location.
</Note>

## Verifying Installation

After deploying your site:

1. Visit your Fern documentation
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 the JavaScript file path in `docs.yml` is correct
* Check that you've deployed the changes to your Fern site
* Verify that your tracker domain is correct and accessible
* Check the browser console for any JavaScript errors

For more help, see our [Troubleshooting guide](/tracker/troubleshooting).

## Additional Resources

* [Fern Custom JavaScript Documentation](https://buildwithfern.com/learn/docs/customization/custom-css-js)
* [Custom Events Tracking](/tracker/custom-events)
* [Website Tracker Overview](/tracker)
