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

# Ghost CMS

> Install Trfyx on a Ghost CMS site using Code Injection.

# Install Trfyx on Ghost CMS

Ghost provides a built-in Code Injection feature that makes adding the Trfyx tracker straightforward.

## Add the tracker with Code Injection

<Steps>
  <Step title="Open Ghost settings">
    Log in to your Ghost admin dashboard and open **Settings → Code Injection**.
  </Step>

  <Step title="Add the tracker to Site Header">
    Paste this snippet into the **Site Header** section:

    ```html theme={null}
    <script
      defer
      data-website-id="YOUR_TRFYX_PROJECT_ID"
      data-domain="yourdomain.com"
      src="https://app.trfyx.com/script.js"
    ></script>
    ```

    <Warning>
      Replace `YOUR_TRFYX_PROJECT_ID` with your Trfyx Website ID and `yourdomain.com` with the domain you want to track. Keep the script URL as `https://app.trfyx.com/script.js`.
    </Warning>
  </Step>

  <Step title="Save the changes">
    Save the Code Injection settings and open your published site.
  </Step>
</Steps>

## Alternative: custom theme

If you maintain a custom Ghost theme, you can add the Trfyx snippet directly to the theme's `default.hbs` file before the closing `</head>` tag.

## Verify installation

Visit the published site and check Trfyx for incoming activity. Ghost code changes are reflected on the published site, so verify against the live site rather than relying only on the editor preview.

If data is missing, check the browser console, CSP rules, hostname configuration, consent settings, and whether the tracker has been installed more than once.


## Related topics

- [Google Tag Manager](/google-tag-manager.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.