#!/bin/bash set -e echo "╔════════════════════════════════════════════════════════════╗" echo "║ SEO Analysis & Improvement System - Full Pipeline ║" echo "╚════════════════════════════════════════════════════════════╝" echo "" # Check if venv exists if [ ! -d "venv" ]; then echo "❌ Virtual environment not found. Please run: python3 -m venv venv" exit 1 fi # Check if input files exist if [ ! -f "input/new-propositions.csv" ]; then echo "❌ Missing input/new-propositions.csv" echo "Please place your WordPress posts CSV in input/ directory" exit 1 fi if [ ! -f "input/analytics/ga4_export.csv" ]; then echo "❌ Missing input/analytics/ga4_export.csv" echo "Please export GA4 data and place it in input/analytics/" exit 1 fi # Create output directories mkdir -p output/results mkdir -p output/logs echo "📊 Step 1: Analytics Integration" echo " Merging GA4, Search Console, and WordPress data..." ./venv/bin/python analytics_importer.py echo "" echo "🔍 Step 2: Keyword Opportunity Analysis" echo " Identifying high-potential optimization opportunities..." ./venv/bin/python opportunity_analyzer.py \ --input output/results/posts_with_analytics.csv \ --output output/results/keyword_opportunities.csv \ --min-position 11 \ --max-position 30 \ --min-impressions 50 \ --top-n 20 echo "" echo "📝 Step 3: Report Generation" echo " Creating comprehensive SEO optimization report..." ./venv/bin/python report_generator.py echo "" echo "╔════════════════════════════════════════════════════════════╗" echo "║ ✅ Analysis Complete! ║" echo "╚════════════════════════════════════════════════════════════╝" echo "" echo "📂 Results Location:" echo " └─ output/results/seo_optimization_report.md" echo "" echo "📊 Key Files:" echo " ├─ posts_prioritized.csv (all posts ranked 0-100)" echo " ├─ keyword_opportunities.csv (26 optimization opportunities)" echo " └─ posts_with_analytics.csv (enriched dataset)" echo "" echo "📋 Logs:" echo " └─ output/logs/" echo "" echo "🚀 Next Steps:" echo " 1. Open: output/results/seo_optimization_report.md" echo " 2. Review Top 20 Posts to Optimize" echo " 3. Start with Quick Wins (positions 11-15)" echo " 4. Follow 90-day action plan" echo ""