Files
webdev-pipeline/backlog/tasks/task-9 - Integrate-PageSpeed-Insights-into-internal-audits.md
2026-06-03 21:18:36 +02:00

43 lines
1.6 KiB
Markdown

---
id: TASK-9
title: Integrate PageSpeed Insights into internal audits
status: To Do
assignee: []
created_date: '2026-06-03 19:13'
labels:
- mvp
- audit
- pagespeed
dependencies:
- TASK-8
references:
- PRD.md
priority: medium
ordinal: 9000
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
Add Google PageSpeed Insights as an objective internal audit signal. The system should run mobile and desktop checks when possible, store raw results internally, and expose only plain-language implications to the later LLM/text pipeline rather than customer-facing scores.
<!-- SECTION:DESCRIPTION:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 PageSpeed API runs for mobile and desktop strategies for qualified website leads
- [ ] #2 Raw PageSpeed/Lighthouse response data is stored internally in Convex
- [ ] #3 Key metrics are normalized for downstream analysis without exposing scores on customer audit pages
- [ ] #4 Failures, quota errors, and unavailable pages are recorded without failing the entire audit pipeline
- [ ] #5 Generated audit inputs translate technical signals into customer-impact language for later text generation
<!-- AC:END -->
## Implementation Plan
<!-- SECTION:PLAN:BEGIN -->
1. Add PageSpeed API client using environment/Convex secrets.
2. Run mobile and desktop analysis for the lead domain or final URL.
3. Normalize key findings such as load speed, mobile/desktop gap, SEO, accessibility, and best-practice hints.
4. Store raw and normalized results in Convex.
5. Add error handling and dashboard-visible status for quota, timeout, and API failures.
<!-- SECTION:PLAN:END -->