Google PageSpeed Insights
Overview
This node integrates with the Google PageSpeed Insights API to analyze website URLs for performance, accessibility, SEO, and best practices. It is useful for web developers, SEO specialists, and digital marketers who want to evaluate and improve their websites' user experience and search engine rankings.
The "Analyze Single URL" operation allows analyzing one website URL at a time, providing detailed insights into how well the page performs on desktop and/or mobile devices. For example, you can input your homepage URL to get a comprehensive report on its loading speed, accessibility compliance, SEO factors, and recommended improvements.
Properties
| Name | Meaning |
|---|---|
| URL | The website URL to analyze. You can enter it with or without the protocol (https://). The node will add the protocol automatically if missing. |
| Strategy | The device strategy for analysis: - Desktop: Analyze the desktop version of the site. - Mobile: Analyze the mobile version (recommended for modern sites). - Both: Analyze both desktop and mobile versions. |
| Categories | The categories of analysis to include in the report. Options are: - Performance: Metrics like Core Web Vitals. - Accessibility: Compliance with accessibility standards. - Best Practices: Web development best practices. - SEO: Search engine optimization factors. |
| Additional Options | A collection of optional settings: - Locale: Language for localized results (e.g., English, Spanish, French, etc.). - Include Screenshot: Whether to include a screenshot of the analyzed page. - Output Format: Level of detail in the output (Complete, Scores Only, Core Metrics, Summary). - Skip Content Validation: Skip checking if the URL returns HTML content (useful for non-HTML endpoints). - Retry Attempts: Number of retries for failed requests (0–5). - Custom Timeout: Timeout for API requests in seconds (10–300). |
Output
The node outputs an array with one item containing a json object that holds the analysis results from Google PageSpeed Insights. The structure includes:
- Detailed audit data depending on the selected output format.
- Scores for each selected category (performance, accessibility, best practices, SEO).
- Core Web Vitals metrics if requested.
- Optionally, a screenshot of the analyzed page if enabled.
- Execution metadata including:
- Node version
- Timestamp of execution
- Operation name
- Total number of results returned (always 1 for this operation)
If screenshots are included, binary data representing the image is also part of the output.
Dependencies
- Requires a valid Google PageSpeed Insights API key credential configured in n8n.
- Network access to Google's PageSpeed Insights API endpoint.
- 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: URLs must be valid; the node adds https:// if missing. Incorrect URLs may cause errors.
- Timeouts and Retries: Requests may fail due to network issues or API limits. Adjust retry attempts and custom timeout properties as needed.
- Content Validation Skipped: Enabling skip content validation may cause errors if the URL does not return HTML content (e.g., XML or API endpoints).
- General API Errors: Errors from the API or network issues result in a descriptive error message suggesting to check API key, URL format, and network connection.