Docs

Ghost Integration Guide

Add Heyo live chat to your Ghost publication. Perfect for memberships and subscriber engagement.

This guide shows you how to add Heyo to your Ghost publication. Works with Ghost(Pro) and self-hosted Ghost.

Installation

Site-Wide Installation

  1. In your Ghost Admin, go to Settings
  2. Click Code injection
  3. Paste this code in the Site Header section:
<script src="https://heyo.so/embed/script" defer data-project-id="YOUR_PROJECT_ID"></script>
  1. Click Save

The chat widget will now appear on all pages of your publication.

Member-Only Chat

Show chat only to logged-in members:

<script src="https://heyo.so/embed/script" defer data-project-id="YOUR_PROJECT_ID"></script>

{{#if @member}}
<script>
window.addEventListener('load', function() {
  if (window.HEYO) {
    window.HEYO.init({
      projectId: 'YOUR_PROJECT_ID',
      user: {
        name: '{{@member.name}}',
        email: '{{@member.email}}',
        id: '{{@member.uuid}}'
      }
    });
  }
});
</script>
{{else}}
<style>
  #heyo-widget-button {
    display: none !important;
  }
</style>
{{/if}}

Premium Member Perks

Offer chat as a premium member benefit:

<script src="https://heyo.so/embed/script" defer data-project-id="YOUR_PROJECT_ID"></script>

{{#if @member}}
  {{#has status="paid"}}
  <script>
  window.addEventListener('load', function() {
    if (window.HEYO) {
      window.HEYO.init({
        projectId: 'YOUR_PROJECT_ID',
        user: {
          name: '{{@member.name}}',
          email: '{{@member.email}}',
          subscription: 'premium'
        }
      });
      window.HEYO.show();
    }
  });
  </script>
  {{else}}
  <style>
    #heyo-widget-button {
      display: none !important;
    }
  </style>
  {{/has}}
{{/if}}

Advanced Usage

Show on Specific Pages

Use Ghost's route helpers:

<script src="https://heyo.so/embed/script" defer data-project-id="YOUR_PROJECT_ID"></script>

{{#is "post"}}
<script>
// Show chat on blog posts
window.HEYO?.show();
</script>
{{/is}}

{{#is "page"}}
<style>
  /* Hide chat on static pages */
  #heyo-widget-button {
    display: none !important;
  }
</style>
{{/is}}

Pass Member Tier Information

{{#if @member}}
<script>
window.addEventListener('load', function() {
  if (window.HEYO) {
    window.HEYO.init({
      projectId: 'YOUR_PROJECT_ID',
      user: {
        name: '{{@member.name}}',
        email: '{{@member.email}}',
        tier: '{{#foreach @member.subscriptions}}{{tier.name}}{{/foreach}}',
        status: '{{@member.status}}'
      }
    });
  }
});
</script>
{{/if}}

Custom Trigger in Posts

Add a custom chat button to your posts using Ghost's markdown/HTML:

<button onclick="window.HEYO?.show()" style="padding: 12px 24px; background: #6366f1; color: white; border: none; border-radius: 8px; cursor: pointer;">
  Chat with me about this post
</button>

Theme Integration

Modify Theme Files

For more advanced integration, you can modify your Ghost theme:

  1. Download your theme (Settings > Design)
  2. Extract the zip file
  3. Add Heyo script to default.hbs in the <head> section
  4. Re-zip and upload the theme

This allows version control and more granular placement.

Custom Theme Development

If building a custom theme, add to default.hbs:

<!DOCTYPE html>
<html>
<head>
    {{! ... other head content ... }}
    <script src="https://heyo.so/embed/script" defer data-project-id="{{@site.heyo_project_id}}"></script>
</head>
<body>
    {{{body}}}
</body>
</html>

Note: You'll need to replace {{@site.heyo_project_id}} with your actual project ID since Ghost doesn't support custom site properties by default.

Best Practices

  • Use Site Header for simplest installation
  • Leverage member context for personalized chat
  • Consider premium-only chat as a membership perk
  • Use conditional rendering for page-specific chat
  • Test with different membership tiers
  • Don't show chat on newsletter subscription confirmation pages

Troubleshooting

Chat widget not appearing

  • Verify Project ID is correct
  • Check that code is in Site Header
  • Clear Ghost cache (Settings > Labs > Delete all content)
  • Check browser console for JavaScript errors

Member data not showing

  • Ensure you're using correct Ghost helper syntax ({{@member}})
  • Test while logged in as a member
  • Check that member context is available

Chat showing for non-members

  • Verify conditional logic: {{#if @member}}...{{/if}}
  • Check that styling to hide widget is applied correctly
  • Test in incognito mode (logged out)

Not working with custom theme

  • Ensure Heyo script is in the <head> tag
  • Check that theme is properly uploaded and active
  • Verify no JavaScript conflicts in theme

Ghost(Pro) vs Self-Hosted

Heyo works identically on both:

  • Ghost(Pro): Use Code Injection (easiest)
  • Self-Hosted: Code Injection or theme modification (more control)

Integration with Ghost Features

Works alongside:

  • Ghost memberships
  • Ghost newsletters
  • Ghost Portal
  • Custom themes
  • Ghost Analytics
  • Third-party integrations

Next Steps