Files
manoon-headless/scripts/gsc-monitoring/QUICKSTART.md
Unchained 771e9dc20b
Some checks failed
Build and Deploy / build (push) Has been cancelled
docs: add GSC monitoring quickstart guide
2026-03-30 17:18:51 +02:00

122 lines
3.1 KiB
Markdown

# Google Search Console Monitoring Setup
## ✅ What's Been Created
I've created a complete automated monitoring system in `scripts/gsc-monitoring/`:
### Files Created:
1. **monitor.py** - Python script that fetches GSC data
2. **requirements.txt** - Python dependencies
3. **Dockerfile** - Container image definition
4. **cronjob.yaml** - Kubernetes CronJob for daily runs
5. **README.md** - Full setup documentation
### What It Monitors:
- ✅ Search analytics (clicks, impressions, CTR, position)
- ✅ Top 5 search queries daily
- ✅ Crawl errors
- ✅ Sitemap status
- ✅ Runs daily at 9 AM UTC
---
## 🚀 Next Steps (Do These Now)
### Step 1: Create Google Cloud Project
1. Go to https://console.cloud.google.com
2. Create new project named `manoonoils-monitoring`
3. Enable "Google Search Console API" in APIs & Services → Library
### Step 2: Create Service Account
1. Go to IAM & Admin → Service Accounts
2. Create service account: `gsc-monitor`
3. Grant role: "Search Console Viewer" (or "Owner")
### Step 3: Download Key
1. Click on the service account → Keys tab
2. Add Key → Create New Key → JSON
3. **Download and save the JSON file**
### Step 4: Add to Search Console
1. Go to https://search.google.com/search-console
2. Select `manoonoils.com` property
3. Settings → Users and Permissions → Add User
4. Add the service account email from the JSON file
5. Permission level: "Full"
### Step 5: Deploy to Kubernetes
Run on your server:
```bash
# Copy the JSON key to your server
scp /path/to/downloaded-key.json doorwaysftw:/tmp/gsc-key.json
# Create the Kubernetes secret
ssh doorwaysftw "kubectl create secret generic gsc-service-account \
--namespace=manoonoils \
--from-file=service-account.json=/tmp/gsc-key.json"
# Deploy the monitoring CronJob
ssh doorwaysftw "kubectl apply -f -" < scripts/gsc-monitoring/cronjob.yaml
# Verify it's scheduled
ssh doorwaysftw "kubectl get cronjob gsc-monitoring -n manoonoils"
```
---
## 📊 Viewing Reports
### Check Latest Report:
```bash
ssh doorwaysftw "kubectl create job --from=cronjob/gsc-monitoring gsc-manual-test -n manoonoils
sleep 10
kubectl logs job/gsc-manual-test -n manoonoils
kubectl delete job gsc-manual-test -n manoonoils"
```
### Reports include:
- Total clicks & impressions (last 7 days)
- Average CTR and position
- Top 5 search queries
- Crawl errors summary
- Sitemap status
---
## 🔒 Security
- Service account has **read-only** access to GSC
- Credentials stored as Kubernetes Secret
- JSON key never committed to git
- Rotate key every 90 days
---
## 📚 Full Documentation
See `scripts/gsc-monitoring/README.md` for:
- Detailed setup instructions
- Troubleshooting guide
- Updating the monitor
- Changing schedule
---
## ⏱️ Timeline
**Setup time:** 10-15 minutes
**First report:** After setup (manual run) or next day (automatic)
**Data availability:** 48-72 hours after setup (Google processes data)
---
## ❓ Questions?
The README.md has full troubleshooting. Common issues:
- "User does not have permission" → Wait 5-10 min after adding to GSC
- "Site not found" → Verify URL in monitor.py matches exactly
**Ready to proceed?** Start with Step 1 above!