page_health_score
Compute a 0-100 health score for any page by combining data from Google Search Console, GA4, CrUX, and schema validation. Identify indexing, traffic, performance, and schema issues.
Instructions
Compute a 0-100 health score for a single page by combining GSC, GA4, CrUX, and schema data.
Each component contributes a portion of the total score (100 pts):
GSC (30 pts): indexing_state == "INDEXING_ALLOWED" -> 20 pts; verdict == "PASS" -> 10 pts
GA4 (25 pts): active_users > 0 -> 15 pts; engagement_rate > 0.4 -> 10 pts
CrUX (25 pts): LCP good -> 10 pts; INP good -> 8 pts; CLS good -> 7 pts
Schema (20 pts): schemas found -> 10 pts; no validation errors -> 10 pts
GA4, CrUX, and Schema components are each wrapped in try/except RuntimeError so that missing credentials or insufficient data degrade the score gracefully. The final score is renormalized over available components: score = round((earned / max_available) * 100). If all components fail, returns score=0.
property_id overrides GA4_PROPERTY_ID for multi-property setups. hostname and country are forwarded to GA4 for scoped queries.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| site | Yes | ||
| country | No | ||
| hostname | No | ||
| property_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |