# Blog Monitoring Runbook

**Last Updated:** 2026-02-08

Complete runbook for automated blog monitoring, quality checks, and performance tracking.

## Overview

This runbook documents all automated monitoring processes, their schedules, dependencies, and troubleshooting procedures.

## Automated Processes

### Weekly Quality Checks

**Script:** `v2/scripts/blog/weekly-quality-check.php`

**Schedule:** Every Monday at 9:00 AM

**What it checks:**

- **FAQ Quality:**
  - Answer length (target: 40-80 words)
  - Keyword integration (target: 50%+ FAQs)
  - Internal links in FAQs (target: 1-2 per FAQ)
  - FAQ count (target: 8-10 Ratgeber, 5-8 Lexikon)

- **Link Health:**
  - Anchor text quality (no stop words, descriptive)
  - Generic links (avoid "hier", "mehr", etc.)
  - Link relevance and context

- **Schema Validation:**
  - Article schema completeness
  - FAQPage schema validity
  - HowTo schema detection and generation

- **Content Freshness:**
  - Publication dates current
  - Modification dates updated
  - Statistics and examples current (2026)

**Output:** `docs/content/blog/reports/weekly-quality-check-YYYY-MM-DD.md`

**Email Alerts:** Sent to `hady@ordio.com` if issues found

**Dependencies:**
- `audit-faq-quality.php`
- `analyze-link-quality.php`
- `blog-template-helpers.php`

**Troubleshooting:**

- **Script fails:** Check PHP error logs, verify dependencies exist
- **No report generated:** Check write permissions on reports directory
- **Email not sent:** Verify email configuration in script

### Weekly Priority Refresh

**Script:** `v2/scripts/blog/weekly-priority-refresh.php`

**Schedule:** Every Monday at 10:00 AM (after quality check)

**What it does:**

- Collects latest GA4 data for all posts
- Collects latest GSC data for all posts
- Recalculates priority scores
- Generates priority dashboard
- Updates improvement recommendations

**Output:** 
- Updated post JSON files with latest performance data
- Priority dashboard: `docs/content/blog/reports/priority-dashboard-YYYY-MM-DD.md`

**Dependencies:**
- GA4 API credentials
- GSC API credentials
- `collect-post-performance-ga4.php`
- `collect-post-performance-gsc.php`
- `calculate-comprehensive-priority.php`

**Troubleshooting:**

- **API errors:** Check API credentials, verify quota limits
- **Missing data:** Verify post URLs are correct in GA4/GSC
- **Score calculation errors:** Check data format, verify calculation script

### Domain visibility (SISTRIX)

**Script:** `v2/scripts/blog/collect-domain-visibilityindex.php`

**Schedule:** Weekly (e.g. after weekly-priority-refresh) or monthly. Uses 1 SISTRIX credit per run; 7-day cache (skip if file is fresh).

**Pre-collection check (optional):** Verify API key and remaining credits (no cost):
```bash
php v2/scripts/blog/check-sistrix-credits.php
```

**Command:**
```bash
php v2/scripts/blog/collect-domain-visibilityindex.php
# Optional: --force to ignore cache, --dry-run to test
```

**Output:** `docs/content/blog/domain-level-data/domain-visibilityindex.json`

**Where to read:** [COLLECTION_HEALTH_DASHBOARD.md](COLLECTION_HEALTH_DASHBOARD.md) – "Domain SEO health" section shows the visibility index. Regenerate the dashboard after collection: `php v2/scripts/blog/monitor-collection-health.php`

### Domain SEO overview (SISTRIX)

**Script:** `v2/scripts/blog/collect-domain-seo-overview.php`

**Schedule:** Weekly (e.g. same day as domain visibility). Uses **~16 SISTRIX credits per run** (domain.overview 5 cr + domain.ranking.distribution 1 cr + domain.competitors.seo limit=10 → 10 cr). 7-day cache (skip if all three output files are fresh; use `--force` to refresh).

**Command:**
```bash
php v2/scripts/blog/collect-domain-seo-overview.php
# Optional: --force to ignore cache, --dry-run to test
```

**Output:** `docs/content/blog/domain-level-data/domain-overview.json`, `domain-ranking-distribution.json`, `domain-competitors-seo.json`

**Where to read:** [COLLECTION_HEALTH_DASHBOARD.md](COLLECTION_HEALTH_DASHBOARD.md) – "Domain SEO overview" block (SEO kw count, ranking distribution, top 5 competitors). Regenerate the dashboard after collection: `php v2/scripts/blog/monitor-collection-health.php`

### Domain-level opportunities, content ideas, and competitive gaps

**Scripts:** `collect-domain-opportunities.php`, `collect-domain-content-ideas.php`, `collect-competitor-keywords.php`

**Output:** `domain-level-data/domain-opportunities.json`, `content-ideas.json`, `competitor-keywords.json`, **competitive-gaps.json** (keywords competitors rank for that we don’t; produced by collect-competitor-keywords.php from competitor keyword data and our post keywords).

**Schedule:** Run at least monthly (or bi-weekly) so the [competitive analysis report](reports/competitive-analysis-YYYY-Q.md) and [content backlog](CONTENT_BACKLOG.md) have fresh data. Run `collect-domain-seo-overview.php` first if you want an up-to-date competitor list before collect-competitor-keywords (which uses a fixed competitor list; see script for details).

### Tier 2 SISTRIX collection (optional)

When budget allows, run existing SISTRIX collectors for **Tier 2** posts so more content gets SISTRIX-backed recommendations (serp-features, search-intent, competition-levels; optionally PAA). Use the same Tier list as in [check-data-freshness.php](v2/scripts/blog/check-data-freshness.php) or [FAQ_REBUILD_PRIORITY_LIST.md](FAQ_REBUILD_PRIORITY_LIST.md).

**Schedule:** Bi-weekly (e.g. second and fourth Monday of month, after weekly-priority-refresh) or monthly (e.g. first Monday). **Estimated credits:** ~30 Tier 2 posts × ~35 cr/post (serp-features + search-intent + competition-levels) ≈ 1,050 cr per full Tier 2 run; acceptable with current weekly headroom (10,000 cap).

**Tier-based limits (config:** `v2/config/sistrix-collection-limits.php`**):** Tier 1 posts get 15 related keywords (marketplace.keyword.search.ideas) and 5 competitor keywords; Tier 2 gets 5 related and 3 competitor. See [SISTRIX_USAGE_AUDIT_REPORT.md](SISTRIX_USAGE_AUDIT_REPORT.md) for full credit estimates (current ~6,171 cr, full expansion ~7,587 cr per run).

**Commands (run with Tier 2 post list or --limit):**
```bash
php v2/scripts/blog/collect-post-serp-features.php --all --limit=30   # adjust to Tier 2 count
php v2/scripts/blog/collect-post-search-intent.php --all --limit=30
php v2/scripts/blog/collect-post-competition-levels.php --all --limit=30
```
**Optional Tier 2 keyword.domain.seo:** If used, cap usage (e.g. top 5–10 Tier 2 posts by priority, 1 keyword each, monthly; document cap e.g. 1,000 cr/month). Check credits before/after: `php v2/scripts/blog/check-sistrix-credits.php`.

**Actual credits:** Depends on post count and cache (7-day). Typical: ~7–10 cr/post for serp-features only; ~35 cr/post for serp-features + search-intent + competition-levels. To verify, run e.g. `collect-post-serp-features.php --all --limit=5` and check `v2/data/blog/sistrix-credits-log.json` before/after.

### Automated Data Collection

**Script:** `v2/scripts/blog/automate-data-collection.php`

**Schedule:** 
- Weekly (GA4/GSC): Every Monday at 11:00 AM
- Monthly (SISTRIX): First Monday of month at 12:00 PM

**What it does:**

- **Weekly Collection:**
  - GA4 performance metrics (sessions, users, bounce rate)
  - GSC search performance (impressions, clicks, position)
  - Updates post JSON files with latest data

- **Monthly Collection:**
  - SISTRIX keyword data (competition, search volume)
  - Domain opportunities
  - SERP features
  - Updates post documentation files

**Credit Management:**

- **SISTRIX:** Tracks credit usage in `v2/data/blog/sistrix-credits-log.json`. **Hard cap: 10,000 credits/week.** Scripts stop when remaining weekly credits are very low (e.g. &lt; 50, script-dependent); there is no 9,500 stop in code—any "reserve" is optional and documentation-only. More credits are acceptable for Tier 2 SISTRIX runs and optional Tier 2 keyword.domain.seo when budget allows.
- **GA4/GSC:** No credit limits, but rate limits apply
- **Error Alerts:** Sent to `hady@ordio.com` if credits low or errors occur

**Output:**
- Updated post JSON files
- Updated documentation files
- Collection report: `docs/content/blog/reports/data-collection-YYYY-MM-DD.md`

**Dependencies:**
- SISTRIX API credentials
- GA4 API credentials
- GSC API credentials
- `collect-post-performance-ga4.php`
- `collect-post-performance-gsc.php`
- `pull-sistrix-data.php`

**Troubleshooting:**

- **SISTRIX credit limit:** Script automatically stops, wait for weekly reset
- **API rate limits:** Script includes retry logic with exponential backoff
- **Missing posts:** Verify post URLs match GA4/GSC property configuration

## Manual Monitoring Tasks

### Monthly Performance Review

**When:** First week of each month

**Tasks:**

1. **Review Performance Reports**
   - Check GA4 traffic trends
   - Review GSC search performance
   - Identify top-performing posts
   - Identify underperforming posts

2. **Review Quality Reports**
   - Check FAQ quality trends
   - Review link health issues
   - Identify schema validation errors
   - Review content freshness

3. **Update Priority List**
   - Recalculate priority scores
   - Update improvement plans
   - Identify quick wins

**Scripts:**

```bash
php v2/scripts/blog/generate-priority-dashboard.php
php v2/scripts/blog/generate-automated-reports.php
```

### Quarterly Competitive Analysis

**When:** First month of each quarter

**Tasks:**

1. **Competitor Content Review**
   - Analyze competitor blog content
   - Identify content gaps
   - Review keyword opportunities
   - Check SERP feature opportunities

2. **Content Gap Analysis**
   - Compare content coverage
   - Identify missing topics
   - Plan new content

3. **Keyword Opportunity Review**
   - Review GSC queries
   - Check SISTRIX opportunities
   - Plan keyword targeting

**Scripts:**

```bash
php v2/scripts/blog/analyze-competitor-content.php
php v2/scripts/blog/identify-content-gaps.php
```

## Alert Configuration

### Error Alerts

**Recipient:** `hady@ordio.com`

**Triggers:**

- Script execution failures
- API errors (rate limits, authentication)
- Credit limit warnings (SISTRIX)
- Data collection failures
- Schema validation errors

### Performance Alerts

**Recipient:** `hady@ordio.com`

**Triggers:**

- Significant traffic drops (>20% week-over-week)
- FAQ quality score drops below 80/100
- Link quality issues detected
- Schema validation failures

## Cron Configuration

### Recommended Cron Schedule

```bash
# Weekly quality check (Monday 9 AM)
0 9 * * 1 cd /path/to/landingpage && php v2/scripts/blog/weekly-quality-check.php --email

# Weekly priority refresh (Monday 10 AM)
0 10 * * 1 cd /path/to/landingpage && php v2/scripts/blog/weekly-priority-refresh.php

# Weekly data collection (Monday 11 AM)
0 11 * * 1 cd /path/to/landingpage && php v2/scripts/blog/automate-data-collection.php --weekly

# Monthly SISTRIX collection (First Monday 12 PM)
0 12 1-7 * * [ $(date +\%u) -eq 1 ] && cd /path/to/landingpage && php v2/scripts/blog/automate-data-collection.php --monthly
```

### Report refresh cadence

Regenerate these reports on schedule so dashboards stay current:

- **DATA_FRESHNESS_REPORT.md** – Weekly (e.g. after `weekly-priority-refresh` or as a separate cron step): `php v2/scripts/blog/generate-data-freshness-report.php`
- **COLLECTION_HEALTH_DASHBOARD.md** – Weekly: `php v2/scripts/blog/monitor-collection-health.php`
- **PRIORITY_DASHBOARD.md** – Generated by `weekly-priority-refresh.php` (step 4); can also run `generate-priority-dashboard.php` standalone
- **TRAFFIC_SEO_SNAPSHOT_*.md** – Monthly or quarterly: `php v2/scripts/blog/generate-traffic-seo-snapshot.php`

Full audit steps and cadence: [AUDIT_RUNBOOK.md](AUDIT_RUNBOOK.md).

## Troubleshooting Guide

### Common Issues

**1. Script Execution Failures**

- **Check:** PHP version compatibility (requires PHP 7.4+)
- **Check:** File permissions on scripts directory
- **Check:** Dependencies are installed
- **Fix:** Review error logs, verify script paths

**2. API Authentication Errors**

- **Check:** API credentials are current
- **Check:** API keys have correct permissions
- **Check:** OAuth tokens are refreshed (GA4/GSC)
- **Fix:** Update credentials in config files

**3. Data Collection Failures**

- **Check:** API quota limits
- **Check:** Rate limiting (add delays)
- **Check:** Network connectivity
- **Fix:** Implement retry logic, check API status

**4. Report Generation Failures**

- **Check:** Write permissions on reports directory
- **Check:** Disk space available
- **Check:** Report template files exist
- **Fix:** Fix permissions, verify directory structure

## Related Documentation

- `BLOG_SCRIPTS_USAGE_GUIDE.md` - Complete script reference
- `CONTENT_CREATION_WORKFLOW.md` - Content creation process
- `FAQ_BEST_PRACTICES.md` - FAQ quality guidelines
- `.cursor/rules/blog-monitoring.mdc` - Cursor rules for monitoring
