Skip to content

dancumberland/Click-Through-Rate-Optimizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Click-Through-Rate Optimizer

AI-powered CTR optimization system for WordPress sites using Google Search Console data.

What It Does

This system automatically:

  • Discovers underperforming pages from Google Search Console
  • Analyzes CTR gaps based on position-adjusted benchmarks
  • Generates AI-powered title improvements using Claude
  • Implements changes via WordPress/RankMath API
  • Measures results and learns from outcomes
  • Reports monthly progress via email

How It Works

  1. Monthly Analysis: Queries GSC for all pages, calculates expected CTR by position
  2. Gap Detection: Finds pages underperforming by 5%+ with sufficient impact
  3. AI Ideation: Generates 10 title variations per page using historical learnings
  4. Implementation: Publishes best title via RankMath API
  5. Measurement: Tracks results over 21-90 days
  6. Learning: Stores outcomes to improve future recommendations

Key Features

  • Threshold-Based: Optimizes ALL pages meeting criteria (not fixed limits)
  • Position-Adjusted: Benchmarks based on actual SERP position
  • Historical Tracking: Preserves GSC data beyond 16-month window
  • Automatic Discovery: No manual page registration needed
  • Self-Improving: Learns which title types work best for your site

Installation

# Clone the repo
git clone https://github.com/yourusername/Click-Through-Rate-Optimizer.git
cd Click-Through-Rate-Optimizer

# Install dependencies
pip install -r requirements.txt

# Install Claude CLI (for AI ideation)
npm install -g @anthropic-ai/claude-code

# Set up configuration
cp .env.example .env
# Edit .env with your site details

Configuration

See docs/SETUP.md for detailed setup instructions.

Required:

  • WordPress site with RankMath SEO plugin
  • Google Search Console property
  • Claude Code subscription (for AI ideation)

Usage

# Run monthly CTR optimization review
python scripts/ctr_orchestrator.py

# Log historical GSC data (run weekly via cron)
python scripts/log_gsc_data.py --days 7

# Evaluate ongoing experiments
python scripts/ctr_orchestrator.py --evaluate-only

Project Structure

ctr_system/          # Core modules
β”œβ”€β”€ config.py        # Configuration and thresholds
β”œβ”€β”€ database.py      # SQLite database operations
β”œβ”€β”€ gsc_client.py    # Google Search Console API
β”œβ”€β”€ analysis.py      # CTR gap analysis
β”œβ”€β”€ ideation.py      # AI-powered title generation
β”œβ”€β”€ implementation.py # WordPress/RankMath API
β”œβ”€β”€ measurement.py   # Experiment evaluation
β”œβ”€β”€ notifications.py # Email/Slack reporting
└── schema.sql       # Database schema

scripts/             # Executable scripts
β”œβ”€β”€ ctr_orchestrator.py  # Main monthly workflow
└── log_gsc_data.py      # Historical data logger

Database

Uses SQLite with tables for:

  • monthly_reviews - Review tracking
  • gsc_page_metrics - Page performance snapshots
  • ctr_experiments - A/B test tracking
  • ctr_benchmarks - Position-based expectations
  • gsc_page_tracking - Page discovery dates
  • gsc_historical_data - Long-term data preservation
  • seo_changes - Change history for publishing pipeline integration

Multi-Site Usage

Each site gets its own:

  • .env file (site-specific config)
  • site_crawl.db (isolated data)
  • CTR_Reports/ directory (reports)

See docs/SETUP.md for multi-site deployment strategies.

License

MIT

Credits

Built by Dan Cumberland for The Meaning Movement

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages