Contentsquare icon

Contentsquare

Use the Contentsquare API

Actions76

Overview

This node integrates with the Contentsquare Speed Analysis API to retrieve performance and scenario reports related to web page speed and user experience. Specifically, the "Get Scenario Reports" operation fetches detailed reports on scenarios analyzed by the Speed Analysis service, which can help identify slowdowns, optimization opportunities, and benchmark performance.

Common use cases include:

  • Monitoring website or application performance over time.
  • Analyzing specific user interaction scenarios to detect bottlenecks.
  • Benchmarking against competitors or historical data.
  • Automating performance report retrieval for dashboards or alerts.

For example, a user might configure this node to pull scenario reports filtered by date range and device type to analyze how mobile users experience page load times compared to desktop users.

Properties

Name Meaning
Query Parameters A collection of optional filters and parameters to customize the scenario reports request. These include:
- Device: Filter results by device type (All, Desktop, Mobile, Tablet).
- End Date: End of the date range for analysis (must be after Start Date).
- Format: Format of the query date range (string).
- Frequency: Filter based on export frequency (string).
- From: Filter based on export format (string).
- Goal ID: Return conversion metrics for a non-ecommerce goal (number).
- IDs: Comma-separated list of segment IDs to filter results (string).
- Limit: Maximum number of results to return (number, minimum 1, default 50).
- Metric Type: Metric aggregation method, either Quantile or Average.
- Order: Order of results, Ascending or Descending.
- Page: Page number of results to retrieve (number).
- Period: Granularity of results, Daily or None (only for date ranges larger than one day).
- Project ID: Target project identifier (required only for account-level API keys).
- Quantile: Percentile used if metric type is Quantile (default 75).
- Scope: Filter based on scope (string).
- Segment IDs: Multiple segments separated by commas to get intersection metrics (number).
- Start Date: Beginning of date range for analysis (must be before End Date).
- State: Filter based on status (string).
- To: End date of the query date range (string).
Request Body JSON object for the request body payload. This is typically empty or customized depending on the operation but is available for advanced usage or when the API requires POST data.

Output

The output is a JSON array where each item corresponds to the response from the Contentsquare Speed Analysis API for the requested scenario reports. The structure depends on the API response but generally includes:

  • Detailed scenario report data such as performance metrics, timings, and other analysis results.
  • Metadata about the scenario reports retrieved.
  • If the API returns no content, the node outputs a status code message indicating "204 No Content".

No binary data output is indicated for this operation.

Dependencies

  • Requires an API authentication token obtained via OAuth2 client credentials flow using a Client ID and Client Secret.
  • The node expects valid credentials configured in n8n containing these authentication details.
  • Network access to the Contentsquare API endpoint (https://api.contentsquare.com/v1).
  • Proper permissions/scopes associated with the API key to access Speed Analysis API endpoints.

Troubleshooting

  • Missing Credentials: Errors like "Missing Client ID or Client Secret." indicate that the required API credentials are not set or incomplete.
  • Failed Token Retrieval: "Failed to retrieve access token" or "Failed to retrieve endpoint" errors mean the OAuth2 token request failed; check credentials and network connectivity.
  • Required Parameter Missing: For some operations, missing required parameters (e.g., Project ID, Job ID) will throw explicit errors. Ensure all mandatory fields are provided.
  • API Errors: Any error returned by the API will be wrapped and reported with the message "Error calling Contentsquare API" along with the original error message.
  • Empty Responses: If the API returns no data, the node outputs a "204 No Content" status. Verify query parameters and date ranges to ensure data exists.

Links and References

Discussion