Google PageSpeed Insights
Overview
This node integrates with the Google PageSpeed Insights API to analyze website URLs for performance, accessibility, SEO, and best practices. Specifically, the Analyze Sitemap operation automatically fetches all URLs listed in a provided XML sitemap, applies optional filters, and performs detailed analysis on each URL.
Common scenarios where this node is beneficial include:
- Auditing an entire website’s pages by analyzing all URLs from its sitemap.
- Monitoring website health and optimization status across multiple pages.
- Filtering URLs to focus on specific sections of a site (e.g., blog posts or product pages).
- Generating reports on web performance and SEO compliance at scale.
Practical example: A digital marketing team wants to regularly check the SEO and performance metrics of all public pages on their e-commerce site. They provide the sitemap URL, set filters to exclude admin or API endpoints, and run the analysis to get comprehensive insights for optimization.
Properties
| Name | Meaning |
|---|---|
| Sitemap URL | URL of the XML sitemap to analyze. All URLs found in this sitemap will be extracted and analyzed. |
| URL Filters | Optional filters to limit which URLs from the sitemap are analyzed. Includes: • Include Pattern: Only analyze URLs containing these comma-separated patterns. • Exclude Pattern: Skip URLs containing these patterns. • Max URLs: Maximum number of URLs to analyze to avoid quota issues. • URL Type: Filter URLs by type — All URLs, Pages Only, or Posts Only. |
| Strategy | Analysis strategy to use: • Desktop: Analyze desktop version. • Mobile: Analyze mobile version (recommended). • Both: Analyze both desktop and mobile versions. |
| Categories | Categories of analysis to perform: • Performance • Accessibility • Best Practices • SEO All categories are recommended for comprehensive results. |
| Additional Options | Extra options including: • Locale: Language for localized formatted results. • Include Screenshot: Whether to include a screenshot of the analyzed page. • Output Format: Level of detail in response (Complete, Scores Only, Core Metrics, Summary). • Skip Content Validation: Skip checking if URLs return HTML content. • Retry Attempts: Number of retries for failed requests. • Custom Timeout: Timeout for API requests in seconds. |
Output
The node outputs an array of JSON objects, each representing the analysis result for one URL extracted from the sitemap. Each JSON object contains:
- Detailed audit data depending on the selected categories (performance metrics, accessibility scores, SEO checks, etc.).
- Metadata about the execution such as node version, timestamp, operation name, and total number of results.
- Optionally, a screenshot of the analyzed page if requested.
- The structure varies based on the chosen output format (complete data, scores only, core metrics, or summary).
If screenshots are included, binary data representing the image is attached accordingly.
Dependencies
- Requires a valid Google PageSpeed Insights API key credential configured in n8n.
- Internet access to fetch the sitemap XML and to call the Google PageSpeed Insights API.
- No additional external dependencies beyond the Google API and standard HTTP requests.
Troubleshooting
- Missing or invalid API key: The node throws an error if no API key is found or if validation fails. Ensure the API key credential is correctly configured.
- Invalid sitemap URL: If the sitemap URL is incorrect or inaccessible, the node may fail to retrieve URLs. Verify the sitemap URL is publicly accessible and properly formatted.
- Quota limits: Analyzing many URLs can hit API quota limits. Use the "Max URLs" filter to limit the number of URLs analyzed per execution.
- Timeouts or network errors: Increase the custom timeout or retry attempts in additional options if requests frequently time out.
- Non-HTML URLs: If URLs point to non-HTML content (e.g., APIs), enable "Skip Content Validation" to avoid errors during analysis.
- Unexpected errors: The node logs errors with timestamps; check logs for details and verify network connectivity and API key validity.