Contentsquare icon

Contentsquare

Use the Contentsquare API

Actions76

Overview

This node integrates with the Contentsquare API, specifically supporting multiple resources including the Speed Analysis API. The "Get Analysis Report" operation under the Speed Analysis API resource allows users to retrieve detailed performance analysis reports of web pages. This is useful for monitoring page speed, identifying slowdowns, and benchmarking website performance against competitors.

Typical use cases include:

  • Fetching performance reports after running speed tests on web pages.
  • Automating retrieval of speed analysis data for dashboards or alerts.
  • Integrating speed metrics into broader analytics workflows.

For example, a user might configure this node to request an analysis report for a specific project and date range, then use the output to trigger optimizations or notify stakeholders about performance issues.

Properties

Name Meaning
Query Parameters A collection of optional filters and parameters to customize the analysis report query. Options include: Device (All, Desktop, Mobile, Tablet), Start Date, End Date, Format, Frequency, Goal ID, IDs, Limit, Metric Type (Quantile, Average), Order (Ascending, Descending), Page, Period (Daily, None), Project ID, Quantile (percentile), Scope, Segment IDs, State, To. These allow fine-tuning of the data returned by the report.
Request Body JSON object representing the body of the POST request sent to the API endpoint. This can be used to specify additional parameters or payload required by the API for the analysis report request.

Output

The node outputs the JSON response from the Contentsquare Speed Analysis API's analysis report endpoint. The structure depends on the API response but generally includes detailed metrics and insights about the analyzed web page's speed and performance.

If the API returns binary data (not typical for this operation), it would represent raw report files or HAR data, but for the "Get Analysis Report" operation, the output is JSON containing the report details.

Dependencies

  • Requires valid Contentsquare API credentials including Client ID, Client Secret, and optionally Project ID and Scope.
  • The node performs OAuth2 client credentials flow to obtain an access token before making API requests.
  • Network access to https://api.contentsquare.com is required.
  • Proper configuration of credentials in n8n is necessary to authenticate API calls.

Troubleshooting

  • Missing Credentials: If Client ID or Client Secret are not provided, the node throws an error "Missing Client ID or Client Secret." Ensure these are set correctly in the credentials.
  • Failed Token Retrieval: Errors like "Failed to retrieve access token" or "Failed to retrieve endpoint" indicate issues with authentication or API availability.
  • Required Parameter Missing: Some operations require mandatory parameters (e.g., Job ID, Page Group ID). Omitting these will cause errors specifying which parameter is missing.
  • API Errors: Any HTTP or API errors are wrapped and reported as "Error calling Contentsquare API" with the original message and stack trace if available.
  • Invalid JSON in Request Body: If the Request Body JSON is malformed, the node may fail to parse it, causing errors.

To resolve issues:

  • Verify all required credentials and parameters are provided.
  • Check network connectivity and API status.
  • Validate JSON syntax in the Request Body field.
  • Review error messages for specific missing fields or invalid values.

Links and References

Discussion