Add DataFast to your Ghost CMS site

Follow these steps to integrate DataFast analytics into your Ghost CMS site.

Add tracking script using Code Injection

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

  1. Log in to your Ghost admin dashboard

  2. Go to Settings > Code Injection

  3. In the Site Header section, paste your DataFast tracking script:

    <script
      defer
      data-website-id="dfid_******"
      data-domain="you_domain.com"
      src="https://datafa.st/js/script.js"
    ></script>
    

    Replace dfid_****** with your actual Website ID from DataFast. Replace you_domain.com with your website's root domain.

  4. Click Save

Alternative: Using a custom theme

If you're using a custom theme, you can add the script directly to your theme's default.hbs file:

  1. Go to Design > Theme Editor
  2. Open default.hbs
  3. Add the script just before the closing </head> tag
  4. Save your changes

Verify installation

After implementing either method:

  • Visit your live website
  • Check your DataFast dashboard for incoming data
  • It might take a few minutes for the first pageviews to appear

For advanced configuration options like localhost tracking, custom API endpoints, or cross-domain setup, see the script configuration reference.

Custom code changes in Ghost appear on the published site, not in the preview.
Something missing? Suggest features ✍️