nordabiz/docs/AUDIT_COMPLETENESS_PLAN.md
Maciej Pienczyn ce6aa53c78
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
feat(audit): Phase 1 - YouTube API, CrUX field data, security headers, image formats
New services:
- youtube_service.py: YouTube Data API v3 integration for channel stats
  (subscriber count, view count, video count)
- crux_service.py: Chrome UX Report API for real user field data
  (INP, LCP, CLS, FCP, TTFB from actual Chrome users)

SEO audit enrichment:
- Security headers check: HSTS, CSP, X-Frame-Options, X-Content-Type-Options
  via live requests.head() during data collection
- Image format analysis: WebP/AVIF/SVG vs legacy JPEG/PNG ratio
- CrUX field data complements existing PageSpeed lab data in AI prompt
- All new metrics passed to Gemini for richer analysis

Social media audit enrichment:
- YouTube API data (video count, views, subscribers) integrated into
  social media AI prompt when YouTube profile exists

All APIs use existing GOOGLE_PLACES_API_KEY (free tier, $0 cost).
Completeness: ~68% → ~78% (estimated)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 11:32:03 +01:00

113 lines
6.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Plan Kompletności Audytów NordaBiz
**Data analizy:** 2026-02-08
**Zespół:** 4 agentów specjalistów + moderator-architekt
**Obecna kompletność:** ~52% | **Cel po F3:** ~93%
## Stan Implementacji
### Faza 0: Quick Wins (1-3 dni, $0) — UKOŃCZONA (2026-02-08)
- [x] **GBP bugfix:** review_response_rate — naprawiono: sprawdza `ownerResponse` zamiast `authorAttribution.displayName`
- [x] **GBP phantom fields:** has_posts, has_products, has_qa oznaczone jako `[dane niedostępne bez autoryzacji OAuth]`
- [x] **GBP prompt:** dodano review_keywords i description_keywords do promptu AI
- [x] **SEO: FID→INP:** zastąpiono FID przez INP w prompcie i szablonach (progi: 200ms/500ms)
- [x] **SEO: 10 metryk do promptu:** FCP, TTFB, TBT, Speed Index, meta title/desc length, schema details, html lang
- [x] **Social: engagement_rate** — obliczane z industry base_rate × activity_multiplier
- [x] **Social: posting_frequency_score** — 0-10 based on posts_count_30d
- [x] **Social: enrichment promptu** — last_post_date, page_name, engagement metrics, brand consistency
**Agenci Phase 0 (team: phase0-quickwins):**
- gbp-fixer: Fix review_response_rate + GBP prompt enrichment
- seo-enricher: INP + 10 metryk SEO do promptu
- social-enricher: engagement_rate + posting_frequency_score + social prompt
### Faza 1: API Key Integrations (0 PLN, 1 tydzień)
- [ ] Podpiąć `GooglePlacesService` do przepływu audytu GBP (MIGRACJA z legacy API)
- `GooglePlacesService` w `google_places_service.py` — gotowy kod, NIGDY nie wywoływany w audycie!
- Daje +20 pól: primaryType, editorialSummary, generativeSummary, reviewSummary, paymentOptions, parkingOptions, accessibilityOptions
- Koszt: $0 (150 firm mieści się w free tier Enterprise: 1000 req/mies)
- [ ] CrUX API — field data z realnych użytkowników Chrome (INP, LCP, CLS, FCP, TTFB)
- API Key, darmowy, 150 req/min
- Nowy plik: `crux_service.py`
- [ ] YouTube Data API v3 — subscriberCount, viewCount, videoCount
- API Key (mamy GOOGLE_PLACES_API_KEY), włączyć w Cloud Console
- 10k units/dzień, 150 firm = 0.15% limitu
- Nowy plik: `youtube_service.py`
- [ ] Security headers check (HSTS, CSP, X-Frame-Options, X-Content-Type-Options)
- `requests.head()` + sprawdzenie nagłówków
- [ ] Image format analysis (WebP/AVIF vs JPEG/PNG)
- [ ] Implementacja Brave Search stub (`_search_brave()` zwraca None — nigdy niezaimplementowany)
- [ ] Migracja DB: nowe kolumny (INP, CrUX, security headers, image formats)
### Faza 2: Migracja GBP na Places API (New) (0 PLN, 2 tygodnie)
- [ ] Zamienić `fetch_google_business_data()` (legacy `maps.googleapis.com/maps/api/place/`) na `GooglePlacesService.get_place_details()` (`places.googleapis.com/v1/`)
- [ ] Dodać ekstrakcję: primaryType, editorialSummary, attributes, generativeSummary, reviewSummary
- [ ] Zaktualizować scoring algorithm
- [ ] Zaktualizować szablony HTML
- [ ] Migracja bazy danych (primary_type, editorial_summary, payment_options, parking_options, accessibility_options)
### Faza 3: OAuth Framework (0 PLN API, 2-4 tygodnie dev)
- [ ] Shared OAuth 2.0 framework (`oauth_service.py`)
- [ ] GBP Business Profile API:
- Scope: `business.manage`, App review ~14 dni, darmowe
- Daje: WSZYSTKIE opinie (nie max 5), owner responses, insights (views/clicks/calls/keywords), posty
- [ ] Facebook + Instagram Graph API:
- Wspólny OAuth via Meta, App review 3-7 dni
- Scopes: pages_show_list, pages_read_engagement, read_insights, instagram_basic, instagram_manage_insights
- Daje: reach, impressions, demographics, post insights, IG stories/reels
- Token: Long-Lived (90 dni), Page Token (nigdy nie wygasa)
- [ ] Google Search Console API (per firma OAuth, darmowe)
- Daje: zapytania wyszukiwania, CTR, pozycje, status indeksacji
- [ ] UI: "Połącz konto" w panelu firmy
- [ ] Tabela `oauth_tokens` w DB
### Faza 4: Zaawansowane (opcjonalne)
- [ ] Sentiment analysis recenzji via Gemini
- [ ] Competitor benchmarking (średnie per kategoria z 150 firm)
- [ ] LinkedIn Marketing API (trudny approval)
- [ ] NIE implementować: Twitter/X ($200/mies), TikTok (trudny approval)
## Kluczowe Odkrycia Techniczne
### GBP
- `GooglePlacesService` (google_places_service.py) — gotowy client Places API (New), ZAIMPORTOWANY w gbp_audit_service.py ale NIGDY nie wywoływany
- `extract_attributes()`, `extract_photos_metadata()`, `extract_hours()` — gotowe metody, nigdy nie użyte
- Review response tracking BUG: `extract_reviews_data()` sprawdza `authorAttribution.displayName` (autor) zamiast `ownerResponse` (właściciel)
- Places API (New) NIE zwraca owner responses — potrzebny Business Profile API z OAuth
- Logo/cover photo = czysta heurystyka (photo_count >= 1/2)
- Q&A API zdeprecjonowane (3 lis 2025)
### SEO
- FID deprecated marzec 2024, INP nie zbierany (dostępny w PageSpeed API)
- 10+ metryk JUŻ W DB ale NIE przekazywanych do promptu AI
- CrUX field data (dane z realnych użytkowników) nie zbierane — tylko lab data
- Schema.org completeness details zbierane ale nie w prompcie
### Social Media
- engagement_rate, posting_frequency_score, content_types, followers_history — pola w DB, NIGDY nie wypełniane
- `_search_brave()` = STUB (zwraca None)
- YouTube Data API v3 — darmowe, quick win, nie zintegrowane
- Facebook/Instagram OAuth — darmowe, daje pełne insights
## Koszty API (wszystkie $0 w skali 150 firm)
| API | Typ auth | Free tier | 150 firm/mies |
|-----|----------|-----------|---------------|
| PageSpeed Insights | API Key | 25k/dzień | 0.6% |
| Places API (New) | API Key | $200 credit/mies | ~$7.50 (w ramach credit) |
| CrUX API | API Key | 150 req/min | 0.1% |
| YouTube Data API v3 | API Key | 10k units/dzień | 0.15% |
| Brave Search | API Key | 2k req/mies | ~50% |
| GBP Business Profile | OAuth | unlimited | minimal |
| Facebook Graph | OAuth | 200 req/user/h | adequate |
| Google Search Console | OAuth | 20 QPS | adequate |
## Wpływ na Kompletność
| | Obecny | F0 | F1 | F2 | F3 |
|---|--------|-----|-----|-----|-----|
| GBP | 55% | 60% | 75% | 90% | 98% |
| SEO | 60% | 75% | 85% | 85% | 95% |
| Social | 35% | 50% | 65% | 65% | 85% |
| **Średnia** | **52%** | **68%** | **78%** | **83%** | **93%** |