This document explains the SEO, AEO, and analytics setup for SBDK.dev.
-
Meta Tags (app/layout.tsx:5-62)
- Title with template
- Description
- Keywords
- Authors, creator, publisher
- Robots directives
- Open Graph tags for social sharing
- Twitter card metadata
- Canonical URLs
-
Sitemap (app/sitemap.ts)
- Automatically generated at
/sitemap.xml - Includes homepage and pricing page
- Configured with change frequency and priority
- Automatically generated at
-
Robots.txt (app/robots.txt)
- Allows all search engines
- Points to sitemap
- Configured with crawl delay
We use Schema.org JSON-LD markup for better visibility in AI-powered search engines:
-
SoftwareApplication Schema (app/layout.tsx:77-107)
- Application details
- Pricing information
- Rating information
- Download URL
-
Organization Schema (app/layout.tsx:109-125)
- Company information
- Logo and social links
- Description
-
FAQPage Schema (app/layout.tsx:127-186)
- All FAQ questions and answers
- Optimized for Google's FAQ rich results
- Helps with voice search and AI assistants
- Better visibility in ChatGPT, Perplexity, and other AI search tools
- Enhanced rich snippets in Google Search
- Improved voice search optimization
- Better featured snippet opportunities
-
Go to Google Search Console
- Visit Google Search Console
- Sign in with your Google account
-
Add Your Property
- Click "Add Property" or "Add a property"
- Choose "URL prefix" option
- Enter:
https://sbdk.dev - Click "Continue"
-
Get Verification Code
- Google will show several verification methods
- Select "HTML tag" method
- You'll see a meta tag that looks like:
<meta name="google-site-verification" content="abc123XYZ..." />
- Copy ONLY the content value (the part inside quotes after
content=) - Example: If the tag is
content="abc123XYZ", copyabc123XYZ
-
Add Code to Your Site
- Open
app/layout.tsx:75 - Replace
YOUR_VERIFICATION_CODEwith the code you copied - Before:
<meta name="google-site-verification" content="YOUR_VERIFICATION_CODE" />
- After:
<meta name="google-site-verification" content="abc123XYZ" />
- Open
-
Deploy and Verify
- Commit and push your changes
- Wait for deployment to complete
- Go back to Google Search Console
- Click "Verify" button
- Google will check your site and confirm verification
-
Submit Sitemap
- After verification, go to "Sitemaps" in the left menu
- Enter:
sitemap.xml - Click "Submit"
File: app/layout.tsx:75
<meta name="google-site-verification" content="YOUR_VERIFICATION_CODE" />- Sign up at posthog.com
- Create a new project
- Go to Project Settings → Project Variables
- Copy your Project API Key (starts with
phc_)
-
Go to Repository Settings
- Navigate to your GitHub repository: https://github.com/sbdk-dev/sbdk.dev
- Click "Settings" tab
- Click "Secrets and variables" → "Actions" in left sidebar
-
Add Repository Secrets Click "New repository secret" and add:
Secret 1:
- Name:
NEXT_PUBLIC_POSTHOG_KEY - Value: Your Posthog API key (e.g.,
phc_abc123...)
Secret 2:
- Name:
NEXT_PUBLIC_POSTHOG_HOST - Value:
https://us.i.posthog.com(or your Posthog instance URL)
- Name:
For Vercel (Detailed Steps):
-
Navigate to Environment Variables
- Go to your Vercel dashboard: https://vercel.com
- Select your project:
sbdk-dev - Click on "Settings" tab
- Click on "Environment Variables" in the left sidebar
-
Add First Variable - PostHog API Key
- Click "Add New" button
- Key:
NEXT_PUBLIC_POSTHOG_KEY - Value: Your PostHog API key (starts with
phc_, e.g.,phc_abc123...) - Environment: Check ✅ "Production" (and optionally Preview and Development)
- Click "Save"
-
Add Second Variable - PostHog Host
- Click "Add New" button again
- Key:
NEXT_PUBLIC_POSTHOG_HOST - Value:
https://us.i.posthog.com - Environment: Check ✅ "Production" (and optionally Preview and Development)
- Click "Save"
-
Redeploy Your Site
- Go to "Deployments" tab
- Click the three dots (⋮) on your latest deployment
- Select "Redeploy"
- Or simply push a new commit to trigger automatic redeployment
-
Verify Analytics Are Working
- Visit your live site
- Open PostHog dashboard
- Go to "Live Events" to see events coming in real-time
- You should see
$pageviewevents appearing
For Netlify:
- Go to Site settings → Environment variables
- Add the same variables as above
- Redeploy
For Railway (RECOMMENDED - Detailed Steps):
-
Navigate to Your Service
- Go to your Railway dashboard: https://railway.app
- Select your project:
sbdk-dev - Click on your service (the one running your Next.js app)
-
Open Variables Tab
- Click on the "Variables" tab
- You'll see a list of existing environment variables
-
Add First Variable - PostHog API Key
- Click "New Variable" or the "+ Add Variable" button
- Variable Name:
NEXT_PUBLIC_POSTHOG_KEY - Variable Value: Your PostHog API key (starts with
phc_) - Press Enter or click "Add"
-
Add Second Variable - PostHog Host
- Click "New Variable" or "+ Add Variable" again
- Variable Name:
NEXT_PUBLIC_POSTHOG_HOST - Variable Value:
https://us.i.posthog.com - Press Enter or click "Add"
-
Automatic Redeployment
- Railway will automatically redeploy your service when variables are added
- Wait for the deployment to complete (watch the deployment logs)
- You'll see the build and deploy process in the logs
-
Verify Analytics Are Working
- Visit your live site (your Railway URL)
- Open PostHog dashboard: https://app.posthog.com
- Go to "Live Events" to see events coming in real-time
- Navigate around your site - you should see
$pageviewevents appearing
For local testing only:
cp .env.example .env.localEdit .env.local:
NEXT_PUBLIC_POSTHOG_KEY=phc_your_actual_key_here
NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.comImportant: Never commit .env.local to git!
The Posthog integration automatically tracks:
- Pageviews: Every page navigation
- Page Leaves: When users leave pages
- Autocapture Events: Clicks on buttons, links, form interactions
- Session Recordings: User sessions (optional, configured in PosthogProvider)
Provider: components/PosthogProvider.tsx
Key features:
- Client-side only (doesn't run on server)
- Manual pageview capture for better control
- Autocapture for common interactions
- Person profiles only for identified users
File: lib/analytics.ts
import { analytics } from '@/lib/analytics'
analytics.track('event_name', {
property1: 'value1',
property2: 'value2'
})analytics.trackButtonClick('Get Started', {
location: 'hero',
target_url: 'https://github.com/sbdk-dev/sbdk-dev'
})analytics.trackDemoInteraction('pipeline_play', {
step: 'extract'
})analytics.trackTerminalCommand('sbdk init my-pipeline')analytics.trackPipelineView('step_completed', {
step_name: 'extract',
duration_ms: 1500
})analytics.trackCTA('hero', 'Try Live Demo', '#demo')analytics.trackSectionView('pricing')analytics.trackExternalLink(
'https://github.com/sbdk-dev/sbdk-dev',
'Star on GitHub'
)analytics.trackGitHubClick('header')Add tracking to a button:
'use client'
import { analytics } from '@/lib/analytics'
export default function CTAButton() {
return (
<button
onClick={() => {
analytics.trackCTA('hero', 'Get Started', 'https://github.com/sbdk-dev/sbdk-dev')
}}
>
Get Started
</button>
)
}For conversion optimization:
- CTA clicks (all major buttons)
- GitHub link clicks
- Demo interactions
- Pricing page views
- Download/install button clicks
For engagement analysis:
- Section scroll depth
- Terminal command executions
- Pipeline visualizer interactions
- FAQ expansions (if implemented)
- Build the site:
npm run build - Check meta tags: View page source
- Validate structured data: Google Rich Results Test
- Check sitemap: Visit
/sitemap.xml - Check robots: Visit
/robots.txt
- Set up Posthog environment variables
- Run dev server:
npm run dev - Open Posthog dashboard
- Navigate the site and watch events appear in real-time
- Check that pageviews and custom events are captured
Posthog not tracking:
- Verify environment variables are set correctly
- Check browser console for errors
- Ensure ad blockers aren't blocking Posthog
- Verify the API key is correct
Schema markup not showing:
- Run Google Rich Results Test
- Allow 1-2 weeks for Google to crawl and index
- Check for JSON-LD syntax errors
- Add Posthog API key to production environment variables
- Replace Google Search Console verification code
- Verify sitemap is accessible at
/sitemap.xml - Verify robots.txt is accessible at
/robots.txt - Submit sitemap to Google Search Console
- Test Posthog events in production
- Set up Posthog dashboards for key metrics
- Configure Posthog alerts for important events
- Organic search traffic (Google Search Console)
- Conversion rate (CTA clicks → GitHub stars)
- Demo engagement (terminal interactions, pipeline views)
- Page scroll depth
- Bounce rate by landing page
- Weekly: Review Posthog event data
- Monthly: Check Google Search Console for crawl errors
- Monthly: Review and update FAQ schema if questions change
- Quarterly: Update structured data based on new features