G Ghost

How to integrate SEO and analytics on Ghost

intermediate 8 min read Updated 2026-03-18
Quick Answer

Integrate SEO and analytics on Ghost by configuring meta data settings, installing Google Analytics tracking code, and setting up Google Search Console. Ghost's built-in SEO features combined with proper analytics tracking provide comprehensive website optimization and performance monitoring.

Prerequisites

  • Ghost CMS admin access
  • Google Analytics account
  • Basic understanding of SEO principles
  • Google Search Console account

Step-by-Step Instructions

1

Configure Ghost SEO Settings

Navigate to Settings → General in your Ghost admin panel. Fill in your Site title and Site description which serve as default meta tags. In the Meta data section, add your site's meta title and description. Enable Make this site private temporarily if you're still in development to prevent indexing.
Keep your meta description under 160 characters for optimal search engine display.
2

Set Up Individual Post SEO

When editing posts, click the Settings gear icon in the top right. Scroll down to find Meta data and Social cards sections. Add custom Meta title, Meta description, and Canonical URL for each post. Upload optimized Feature images and customize Facebook card and Twitter card settings.
Use your target keywords naturally in meta titles and descriptions, but prioritize readability.
3

Install Google Analytics 4

Go to Settings → Code injection in Ghost admin. In the Site header section, paste your Google Analytics 4 tracking code:

<script async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'GA_MEASUREMENT_ID');
</script>
Replace GA_MEASUREMENT_ID with your actual Google Analytics measurement ID.
Test your analytics implementation using Google Analytics Real-time reports after publishing.
4

Set Up Google Search Console

Visit Google Search Console and add your Ghost site as a new property. Choose URL prefix method and enter your domain. For verification, download the HTML verification file and upload it to your Ghost site's Settings → Labs → Routes section, or add the meta tag to Code injection → Site header. Click Verify in Search Console.
HTML file verification is often more reliable than meta tag verification for Ghost sites.
5

Generate and Submit XML Sitemap

Ghost automatically generates XML sitemaps at yoursite.com/sitemap.xml. In Google Search Console, go to Sitemaps in the left sidebar and click Add a new sitemap. Enter sitemap.xml and click Submit. Verify the sitemap is successfully processed and shows no errors.
Check your sitemap regularly to ensure all important pages are included and accessible.
6

Configure Ghost Navigation for SEO

Navigate to Settings → Navigation to set up your primary and secondary navigation menus. Use descriptive anchor text for menu items and organize them in a logical hierarchy. Ensure your most important pages are easily accessible through navigation. Add internal links in your content to improve site structure and SEO.
Keep your navigation menu under 7 main items to avoid overwhelming users and search engines.
7

Set Up Advanced Analytics Tracking

In Settings → Code injection → Site footer, add custom event tracking for important user interactions:

<script>
// Track newsletter signups
document.addEventListener('submit', function(e) {
  if (e.target.classList.contains('subscribe-form')) {
    gtag('event', 'newsletter_signup', {
      'event_category': 'engagement'
    });
  }
});
</script>
This tracks newsletter subscriptions and other custom events in Google Analytics.
Set up goals in Google Analytics to track conversions like newsletter signups or contact form submissions.
8

Monitor and Optimize Performance

Regularly check Google Search Console for crawl errors, search performance, and indexing issues. In Google Analytics, monitor page load times, bounce rates, and user behavior. Use the Page Speed section in Search Console to identify optimization opportunities. Set up Google Analytics alerts for significant traffic changes or errors.
Review your analytics data weekly and Search Console data monthly to stay on top of SEO performance.

Common Issues & Troubleshooting

Google Analytics not tracking visitors

Verify the tracking code is in the Site header section, not footer. Check for JavaScript errors in browser console and ensure the measurement ID is correct.

Search Console verification failing

Clear Ghost cache after adding verification meta tag. Try HTML file verification method by uploading the file to your server root directory instead of using meta tags.

Sitemap not updating with new content

Check Settings → General and ensure your site is not set to private. Ghost automatically updates sitemaps, but it may take time to reflect in Search Console.

Meta descriptions not showing in search results

Ensure meta descriptions are under 160 characters and not keyword-stuffed. Google may choose to generate its own descriptions if yours don't match search intent.

Prices mentioned in this guide are pulled from current plan data and may change. Always verify on the official Ghost website before purchasing.