Contentsquare icon

Contentsquare

Use the Contentsquare API

Actions76

Overview

This node interacts with the Contentsquare API, specifically supporting multiple resources including the Speed Analysis API. The "Get Analysis HAR From Analysis" operation under the Speed Analysis API resource retrieves the HTTP Archive (HAR) data from a specific speed analysis. HAR files contain detailed performance data about web page loads, useful for diagnosing slowdowns and optimizing website performance.

Typical use cases include:

  • Fetching detailed network request and response data from a speed analysis to troubleshoot performance bottlenecks.
  • Integrating performance monitoring data into workflows for automated reporting or alerting.
  • Benchmarking web page load characteristics over time or across different devices.

For example, a user might run a speed analysis on their website and then use this node to retrieve the HAR file to analyze which resources are slowing down page load times.

Properties

Name Meaning
Query Parameters A collection of optional filters and parameters to refine the analysis query. Options include: Device (All, Desktop, Mobile, Tablet), date ranges (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, and To date. These parameters allow precise control over the data returned by the API.
Request Body JSON object representing the body of the POST request sent to the API endpoint. This is used to specify additional details required by some operations, including the "Get Analysis HAR From Analysis" operation. Defaults to an empty JSON object {}.

Output

The output is a JSON array where each item corresponds to the API response for each input item processed. For the "Get Analysis HAR From Analysis" operation, the output JSON contains the HAR data retrieved from the analysis. This includes detailed timing, request, and response information for all network resources involved in the analyzed page load.

If the API returns a string response, the node attempts to parse it as JSON; if parsing fails, it outputs the raw text. If no content is returned, the node outputs a status code message indicating "204 No Content".

The node does not explicitly handle binary data output for this operation.

Dependencies

  • Requires valid credentials for the Contentsquare API, including a Client ID, Client Secret, and optionally a Project ID and scope.
  • The node performs OAuth2 client credentials flow to obtain an access token before making API requests.
  • Network connectivity to https://api.contentsquare.com is required.
  • Proper configuration of the API credentials within n8n is necessary for successful authentication.

Troubleshooting

  • Missing Credentials: The node throws an error if the Client ID or Client Secret is missing. Ensure these are correctly configured.
  • Access Token Retrieval Failure: Errors occur if the OAuth token cannot be obtained. Verify credentials and network access.
  • Required Parameter Missing: Some operations require mandatory parameters (e.g., Job ID, Page Group ID, Zone ID). The node will throw errors if these are not provided.
  • API Errors: Any API call failure results in an error with the message prefixed by "Error calling Contentsquare API". Check the API response and ensure parameters are valid.
  • Invalid JSON in Request Body: The request body must be valid JSON when used; otherwise, the node may fail.
  • Empty or Unexpected Response: If the API returns empty or non-JSON responses, the node tries to handle them gracefully but verify the API behavior and inputs.

Links and References

Discussion