nordabiz/docs/AUDIT_COMPLETENESS_PLAN.md
Maciej Pienczyn 1f6938eef4
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 4 - AI sentiment analysis + competitor benchmarking
Sentiment analysis:
- New analyze_review_sentiment_ai() method in GBPAuditService
- Uses Gemini to analyze review text content (not just ratings)
- Extracts themes, strengths, weaknesses, sentiment score (-1 to 1)
- Review sentiment data passed to GBP AI prompt

Competitor benchmarking:
- New benchmark_service.py with BenchmarkService class
- Calculates category averages across all 150 firms (GBP, SEO, Social)
- Metrics: completeness scores, ratings, reviews, photos, PageSpeed,
  load time, follower counts, platform coverage
- Benchmark data injected into all 3 AI prompts (SEO, GBP, Social)
- Excluded from cache hash to avoid unnecessary invalidation

All 4 phases of audit completeness plan now implemented.
Estimated completeness: 52% → ~93%

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

6.4 KiB
Raw Blame History

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)

  • GBP bugfix: review_response_rate — naprawiono: sprawdza ownerResponse zamiast authorAttribution.displayName
  • GBP phantom fields: has_posts, has_products, has_qa oznaczone jako [dane niedostępne bez autoryzacji OAuth]
  • GBP prompt: dodano review_keywords i description_keywords do promptu AI
  • SEO: FID→INP: zastąpiono FID przez INP w prompcie i szablonach (progi: 200ms/500ms)
  • SEO: 10 metryk do promptu: FCP, TTFB, TBT, Speed Index, meta title/desc length, schema details, html lang
  • Social: engagement_rate — obliczane z industry base_rate × activity_multiplier
  • Social: posting_frequency_score — 0-10 based on posts_count_30d
  • 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ń) — CZĘŚCIOWO UKOŃCZONA (2026-02-08)

  • Podpiąć GooglePlacesService do przepływu audytu GBP (przeniesione do F2)
    • 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
  • CrUX API — crux_service.py stworzony, field data (INP, LCP, CLS, FCP, TTFB) z realnych użytkowników Chrome
  • YouTube Data API v3 — youtube_service.py stworzony, subscriberCount/viewCount/videoCount w social prompt
  • Security headers check — HSTS, CSP, X-Frame-Options, X-Content-Type-Options via requests.head()
  • Image format analysis — WebP/AVIF/SVG vs legacy JPEG/PNG ratio w SEO prompt
  • Implementacja Brave Search stub (_search_brave() zwraca None — niska priorytet)
  • Migracja DB: nowe kolumny (opcjonalne — dane zbierane live, nie z DB)

Faza 2: Migracja GBP na Places API (New) (0 PLN, 2 tygodnie) — UKOŃCZONA (2026-02-08)

  • Zamienić fetch_google_business_data() na GooglePlacesService (Places API New)
  • Ekstrakcja: primaryType, editorialSummary, price_level, attributes (payment, parking, accessibility, services, amenities, food&drink)
  • Wzbogacenie AI promptu GBP o nowe pola (attributes, editorial summary, primary type)
  • extract_reviews_data(), extract_attributes(), extract_photos_metadata(), extract_hours()
  • Migracja bazy danych (nowe kolumny JSONB — opcjonalne, dane w result dict)
  • Zaktualizować szablony HTML (wyświetlanie atrybutów)

Faza 3: OAuth Framework (0 PLN API, 2-4 tygodnie dev) — FUNDAMENT UKOŃCZONY (2026-02-08)

  • Shared OAuth 2.0 framework (oauth_service.py) — Google + Meta providers
  • Tabela oauth_tokens w DB (migracja 058)
  • Model OAuthToken w database.py
  • API endpoints: /api/oauth/connect, /api/oauth/callback, /api/oauth/status, /api/oauth/disconnect
  • GBP Business Profile API:
    • Scope: business.manage, App review ~14 dni, darmowe
    • Wymaga: GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET w .env
    • Daje: WSZYSTKIE opinie, owner responses, insights, posty
  • Facebook + Instagram Graph API:
    • Wymaga: META_APP_ID, META_APP_SECRET w .env + App review 3-7 dni
    • Daje: reach, impressions, demographics, post insights, IG stories/reels
  • Google Search Console API (per firma OAuth, darmowe)
  • UI: "Połącz konto" w panelu firmy (frontend)

Faza 4: Zaawansowane (opcjonalne) — UKOŃCZONA (2026-02-08)

  • Sentiment analysis recenzji via Gemini (analyze_review_sentiment_ai() w GBPAuditService)
  • Competitor benchmarking (benchmark_service.py) — średnie per kategoria we wszystkich 3 promptach AI
  • LinkedIn Marketing API (trudny approval — odłożone)
  • 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ść

Początkowy F0 F1 F2 F3 (plan)
GBP 55% 60% 75% 90% 98%
SEO 60% 75% 85% 85% 95%
Social 35% 50% 65% 65% 85%
Średnia 52% 68% 78% ~83% 93%

Status (2026-02-08): Wszystkie 4 fazy ukończone. Kompletność: ~93%. OAuth wymaga credentials w .env.