Quick Setup Guide - Gemini Integration

Last Updated: November 26, 2025
AI Engine: Google Gemini Flash 1.5
Word Limit: 1200-1500 words

🚀 First-Time Setup (5 Minutes)

Step 1: Configure API Keys

Your Bing API key is already configured! Now add your Gemini API key to .env:

# .env file (C:\dev\itblogpros\.env)

# ✅ Already configured
BING_API_KEY=a280df673609455f92c8c049d84a5b08
INDEXNOW_KEY=635be2ddd75b4e9b87f17325fef28a39
SITE_URL=https://itblogpros.com

# ✅ Add this (already done for you!)
GEMINI_API_KEY=AIzaSyB2BwTcHD5XXgGexBsSwhtZCcL6YqwWPPQ
GEMINI_MODEL=gemini-1.5-flash-latest

# ✅ Word limits configured
MAX_WORD_COUNT=1500
MIN_WORD_COUNT=1200
TARGET_WORD_COUNT=1400

Your Gemini API Details:

Step 2: Verify Dependencies

# Check if @google/generative-ai is installed
npm list @google/generative-ai

# If not installed, run:
npm install @google/generative-ai

Already installed in your package.json!

Step 3: Generate Required Data Files

IMPORTANT: Run these BEFORE generating articles!

# Option A: Use the menu system
cd _automation
START-HERE.bat

# Then select:
# - Option 9: Run Bing Analysis
# - Option 0: Run SEO Check

# Option B: Command line
cd C:\dev\itblogpros
node run-bing-analysis.js
npm run build
node run-seo-check.js

This creates:

Step 4: Test the Integration

# Test article generation with Gemini + Bing
cd _automation
node integrated-system.js test

What This Does:

  1. ✅ Loads Bing opportunities for context
  2. ✅ Generates 1200-1500 word article with Gemini
  3. ✅ Includes relevant keywords from Bing data
  4. ✅ Validates SEO (must score 80+)
  5. ✅ Submits to IndexNow/Bing if quality passes
  6. ✅ Saves tracking data

Expected Output:

🚀 Starting Gemini Article Generation
🔍 Loading Bing opportunities...
✅ Found relevant Bing data:
   - 3 related low-CTR pages
   - 5 search queries to address

🤖 Generating article with Gemini...
✅ Article generated (8,245 chars)

📊 Article Stats:
   📁 File: 2025-11-26-wifi-7-slower-than-expected.md
   📝 Words: 1,456
   🔗 Amazon Links: 5
   ❓ FAQ: ✅
   🏷️  Post Tag: ✅
   ⭐ Quality Score: 92/100

✅ Submitted to IndexNow: true

📊 Understanding Word Limits

Why 1200-1500 Words?

Previous articles were 3000+ words, which caused:

New Optimized Length:

Configuration:

MAX_WORD_COUNT=1500    # Hard limit
MIN_WORD_COUNT=1200    # Minimum acceptable
TARGET_WORD_COUNT=1400 # Ideal target

🎯 Bing Integration Features

What Bing Data Provides

1. Low CTR Pages (Optimization Opportunities)

2. Search Queries (What People Search For)

3. Content Gaps (New Article Ideas)

How Gemini Uses Bing Data

// Gemini prompt automatically includes:

BING OPTIMIZATION DATA (Low CTR Pages to Improve):
- /wifi-speeds-slow/ (5,234 impressions, 0.8% CTR)
- /router-performance/ (3,100 impressions, 1.2% CTR)

Make this article better than existing low-CTR pages by:
- More compelling titles
- Better meta descriptions
- Addressing user questions directly

BING SEARCH QUERIES (What people search):
- "why is wifi 7 slower than wifi 6" (890 searches/month)
- "wifi 7 router speed test" (670 searches/month)
- "fix slow wifi 7 connection" (1,240 searches/month)

Address these search queries in your article.

📝 Article Generation Workflow

Complete Process

# 1. Get Bing opportunities
node run-bing-analysis.js

# 2. View opportunities
node integrated-system.js opportunities

# Output:
# 📋 Top Topics to Create:
# 1. [new_content] why is wifi 7 slower than wifi 6
#    Priority: high | Potential: +890 clicks/month
#    Impressions: 1,240/month

# 3. Generate article with Gemini
node gemini-article-generator.js generate

# 4. Article automatically:
#    - Uses Bing data for context
#    - Stays within 1200-1500 words
#    - Includes relevant keywords
#    - Adds Amazon affiliate links
#    - Creates FAQ section

# 5. Validate SEO
node integrated-system.js health

# 6. Submit to Bing (if quality >= 80)
# (Automatic during generation)

Using the Menu System

cd _automation
START-HERE.bat

# First time:
9 → Run Bing Analysis
0 → Run SEO Check

# Generate articles:
4 → Single Article (interactive)
5 → Batch from CSV

# Monitor:
6 → Check Opportunities
7 → SEO Health
8 → Full Report

🔧 Troubleshooting

"GEMINI_API_KEY not found"

Solution: Add to .env file (already done for you!)

GEMINI_API_KEY=AIzaSyB2BwTcHD5XXgGexBsSwhtZCcL6YqwWPPQ

"No opportunities file found"

Solution:

node run-bing-analysis.js

"Module @google/generative-ai not found"

Solution:

npm install @google/generative-ai

"Article too long" (>1500 words)

Check configuration:

# In .env file
MAX_WORD_COUNT=1500

# Gemini prompt automatically enforces this
# If article exceeds limit, regenerate

"Article too short" (<1200 words)

Check prompts:

"No Bing data in article context"

Verify:

# Check file exists
ls _bing-intelligence/opportunities-latest.json

# Regenerate if needed
node run-bing-analysis.js

📈 Success Metrics

Quality Score Breakdown (100 points)

Target: 80+ for auto-submission to Bing

SEO Score Breakdown (100 points)

Similar to quality score, but focuses on technical SEO:

Target: 70+ for publication

🎉 Ready to Generate!

Your First Article

# 1. Start the menu
cd C:\dev\itblogpros\_automation
START-HERE.bat

# 2. Select option 9 (Bing Analysis)
# Wait for completion (~30 seconds)

# 3. Select option 0 (SEO Check)
# Wait for completion (~1 minute)

# 4. Select option 8 (Full Report)
# Review opportunities

# 5. Select option 4 (Generate Single)
# Follow the prompts

# 6. Article created in /posts directory!
# 7. If quality >= 80, auto-submitted to Bing

Batch Generation

# Create batch-topics.csv:
painPoint,keywords,productType,targetISP,budgetLow,budgetMid,budgetHigh
"Slow WiFi 7 speeds","wifi 7,slow,performance","routers",,200,400,700
"Mesh network dead zones","mesh wifi,dead zones,coverage","mesh",,150,300,500

# Generate all:
node batch-generate.js batch-topics.csv

💡 Pro Tips

Maximize Bing Integration

  1. Weekly Analysis: Run Bing analysis every Monday

    node run-bing-analysis.js
    
  2. Target High-Potential: Focus on opportunities with:

  3. Address Real Queries: Use exact search queries in titles

    Bad:  "WiFi Performance Issues"
    Good: "Why Is My WiFi 7 Router Slower Than Expected?" (actual query)
    
  4. Improve Existing: For low-CTR pages:

Optimize Word Count

# If articles consistently too long:
MAX_WORD_COUNT=1400
TARGET_WORD_COUNT=1300

# If articles consistently too short:
MIN_WORD_COUNT=1300
TARGET_WORD_COUNT=1450

Monitor Performance

# Weekly routine:
node integrated-system.js report

# Check:
# - Average word count (target: 1350-1450)
# - Average quality score (target: 85+)
# - Average SEO score (target: 75+)
# - Submission rate (target: 80%+)

📚 Next Steps

  1. ✅ API keys configured
  2. ✅ Bing analysis run
  3. ✅ SEO check complete
  4. ✅ Test article generated
  5. 🎯 Start generating optimized articles!

Happy writing with Gemini! 🚀


Support: