Google PageSpeed Insights
Analyze website performance, accessibility, and SEO using Google PageSpeed Insights API
Overview
This node integrates with the Google PageSpeed Insights API to compare website URLs based on their performance, accessibility, SEO, and best practices metrics. It supports three comparison modes:
- Compare Two URLs: Directly compares two distinct URLs to highlight differences in their web performance and other analyzed categories.
- Before/After Analysis: Compares a current URL analysis against a previous baseline dataset to track improvements or regressions over time.
- Batch Comparison: Compares multiple URLs provided as input data in batch mode.
This node is beneficial for web developers, SEO specialists, and digital marketers who want to monitor and improve website quality by benchmarking URLs against each other or historical data. For example, it can be used to:
- Compare staging vs production site versions.
- Track performance changes after deploying new code.
- Analyze multiple competitor URLs at once.
Properties
| Name | Meaning |
|---|---|
| Comparison Type | The type of URL comparison to perform. Options: • Compare Two URLs • Before/After Analysis • Batch Comparison |
| First URL | The first URL to compare (required when comparing two URLs). |
| Second URL | The second URL to compare (required when comparing two URLs). |
| URL | The URL to analyze and compare with a baseline (used in before/after analysis). |
| Baseline Data | Previous analysis data to use as a baseline for comparison (optional; if not provided, input data will be used). |
| Strategy | The analysis strategy specifying which device type to simulate. Options: • Desktop • Mobile • Both Mobile-first is recommended for modern web development. |
| Categories | Categories of analysis to include. Multiple selections allowed. Options: • Performance • Accessibility • Best Practices • SEO All are recommended for comprehensive analysis. |
| Additional Options | Collection of optional settings: • Locale: Language for localized results (e.g., English, Spanish, French, etc.) • Include Screenshot: Whether to include a page screenshot in results • Output Format: Level of detail returned (Complete, Scores Only, Core Metrics, Summary) • Skip Content Validation: Skip checking if URLs return HTML content (useful for non-HTML endpoints) • Retry Attempts: Number of retries for failed requests (0-5) • Custom Timeout: API request timeout in seconds (10-300) |
Output
The node outputs an array of JSON objects representing the comparison results. Each output item contains detailed structured data including:
- Scores and metrics for selected categories (performance, accessibility, best practices, SEO).
- Comparison details depending on the chosen comparison type.
- Metadata about execution such as node version, timestamp, operation name, and total results count.
If screenshots are enabled, the output may also include binary data representing the captured page images.
The exact structure varies based on the output format option:
- Complete: Full audit data including all metrics and recommendations.
- Scores Only: Only category scores.
- Core Metrics: Scores plus core web vitals.
- Summary: Scores, key metrics, and top recommendations.
Dependencies
- Requires a valid Google PageSpeed Insights API key credential configured in n8n.
- Network access to Google APIs.
- No additional external dependencies beyond the API key and internet connectivity.
Troubleshooting
- Missing API Key: The node throws an error if no API key is found in credentials. Ensure you have configured a valid Google PageSpeed API key.
- API Key Validation Warning: If the API key validation fails, the node logs a warning but continues execution. Verify your API key permissions and quota.
- Invalid URL Format: Errors may occur if URLs are malformed or missing protocol. Always provide full URLs starting with
http://orhttps://. - Timeouts and Retries: Network issues or slow responses can cause timeouts. Adjust the "Custom Timeout" and "Retry Attempts" properties accordingly.
- Content Validation Skipped: Enabling skip content validation may cause errors if the endpoint does not return HTML content. Use this option only for XML or API endpoints.
- Unknown Operation Error: This indicates an unsupported operation was requested. Confirm the operation property is set correctly.