Guide

Ghost

Ghost Integration

Add ads to your Ghost publication

1 Code Injection (Easiest)

Add ads site-wide using Ghost's built-in code injection.

1

Go to Settings → Code Injection in your Ghost Admin

2

Paste in the Site Footer section

3

Click Save

<!-- Beaver.ad - Inject after content -->
<script>
document.addEventListener('DOMContentLoaded', function() {
    const postContent = document.querySelector('.gh-content, .post-content, article');
    if (postContent) {
        const adDiv = document.createElement('div');
        adDiv.style.cssText = 'text-align:center;margin:40px 0;';
        adDiv.innerHTML = '<p style="font-size:11px;color:#999;margin-bottom:8px;">Sponsored</p><iframe src=\"https://example.com/ad-slot-id\" style=\"width:100%;height:auto;min-height:90px;border:none;overflow:hidden;\" frameborder=\"0\" scrolling=\"no\"></iframe>';
        postContent.appendChild(adDiv);
    }
});
</script>

2 HTML Card in Editor

Add ads to individual posts using the HTML card.

1

Open a post in the Ghost Editor

2

Click + to add a card and select HTML

3

Paste the embed code

<!-- Beaver.ad -->
<div style="text-align:center;margin:30px 0;">
  <iframe src="https://example.com/ad-slot-id" style="width:100%;height:auto;min-height:90px;border:none;overflow:hidden;" frameborder="0" scrolling="no"></iframe>
</div>

3 Theme Template (Advanced)

Edit your Ghost theme to add ads in specific locations.

1

Download your current theme from Settings → Design → Change theme

2

Edit the post.hbs file

3

Add the embed code where you want the ad

4

Zip and upload the modified theme

{{!-- post.hbs - Add after the post content --}}
<article class="post">
    {{content}}
    
    {{!-- Beaver.ad Slot --}}
    <aside class="beaver-ad" style="margin:40px 0;text-align:center;">
        <p class="ad-label" style="font-size:11px;color:#999;margin-bottom:8px;">Sponsored</p>
        <iframe src="https://example.com/ad-slot-id" style="width:100%;height:auto;min-height:90px;border:none;overflow:hidden;" frameborder="0" scrolling="no"></iframe>
    </aside>
</article>

4 Reusable Partial

Create a reusable partial for your ad that can be included anywhere.

1

Create partials/beaver-ad.hbs in your theme

2

Add the ad code to this partial

3

Include with {{> beaver-ad}} anywhere in your templates

{{!-- partials/beaver-ad.hbs --}}
<div class="beaver-ad-container" style="margin:40px auto;text-align:center;max-width:728px;">
    <span class="ad-disclosure" style="display:block;font-size:10px;color:#999;margin-bottom:6px;text-transform:uppercase;letter-spacing:1px;">Sponsored</span>
    <iframe src="https://example.com/ad-slot-id" style="width:100%;height:auto;min-height:90px;border:none;overflow:hidden;" frameborder="0" scrolling="no"></iframe>
</div>

Then use it in any template:

{{> beaver-ad}}