Trackthemetric Logo

Trackthemetric + Ghost CMS

Follow these steps to integrate Trackthemetric analytics into your Ghost CMS site. Use Ghost's built-in Code Injection for the simplest setup, or add the snippet to your theme if you're customizing it.

Option 1
Add tracking script using Code Injection (Recommended)

Ghost provides a built-in Code Injection feature that makes it easy to add scripts site-wide.

1. Log in to your Ghost admin dashboard and go to Settings > Code Injection.

2. In the Site Header section, paste the following snippet:

<script
  defer
  id="TrackTheMetric"
  data-website-id="YOUR_WEBSITE_ID"
  data-domain="YOUR_DOMAIN.COM"
  src="https://app.trackthemetric.com/tracker.js"
></script>

Replace the YOUR_WEBSITE_ID and YOUR_DOMAIN.COM with your actual website ID and root domain.

3. Click Save.

Option 2
Add the script in a custom theme

If you're using a custom theme, you can add the script directly to your theme files.

1. In Ghost admin, go to Design > Theme Editor.

2. Open default.hbs and add the snippet just before the closing </head> tag:

{{! Place just before the closing </head> in default.hbs }}
<script
  defer
  id="TrackTheMetric"
  data-website-id="YOUR_WEBSITE_ID"
  data-domain="YOUR_DOMAIN.COM"
  src="https://app.trackthemetric.com/tracker.js"
></script>

Custom code changes appear on the published site, not in the preview. Be sure to publish for changes to take effect.

Replace the YOUR_WEBSITE_ID and YOUR_DOMAIN.COM with your actual website ID and root domain.

3
Verify the installation

After implementing either method:

  • Visit your live website and browse a couple of pages.
  • Open your Trackthemetric dashboard.
  • It might take a few minutes for the first pageviews to appear.