Contentsquare icon

Contentsquare

Use the Contentsquare API

Actions76

Overview

This node integrates with the Contentsquare API, specifically enabling access to the Speed Analysis API's "Get Monitoring Last Report" operation. It retrieves the most recent performance monitoring report for a specified monitoring setup. This is useful for users who want to programmatically fetch the latest speed and performance metrics of their web pages or applications monitored by Contentsquare.

Common scenarios include:

  • Automatically fetching the latest website performance reports to trigger alerts or further analysis.
  • Integrating performance data into dashboards or reporting tools.
  • Monitoring web page speed trends over time by periodically retrieving the last report.

Example: A user can configure this node to get the last monitoring report for a specific project or device type, then use the data to analyze recent performance issues or improvements.

Properties

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

Output

The node outputs the JSON response from the Contentsquare Speed Analysis API corresponding to the last monitoring report. The structure depends on the API response but typically includes detailed performance metrics, timestamps, and possibly metadata about the monitoring.

If the API returns binary data (not typical for this operation), it would represent raw report files or HAR data, but this operation primarily returns JSON-formatted report data.

Dependencies

  • Requires an API authentication token obtained via OAuth2 client credentials flow using a Client ID and Client Secret.
  • Needs a valid Contentsquare API endpoint URL returned during authentication.
  • Requires proper configuration of credentials in n8n with the necessary API keys and project scope.
  • Network access to https://api.contentsquare.com is required.

Troubleshooting

  • Missing Client ID or Client Secret: The node will throw an error if these credentials are not provided. Ensure they are correctly configured.
  • Failed to retrieve access token or endpoint: Indicates authentication failure; verify credentials and network connectivity.
  • Required parameters missing: Some operations require mandatory IDs (e.g., Job ID, Page Group ID). For this operation, ensure that any required query parameters are set correctly.
  • API errors: If the API returns errors, the node throws an error with the message prefixed by "Error calling Contentsquare API". Check the API documentation and input parameters.
  • Empty or malformed responses: The node attempts to parse JSON responses; if the response is empty or invalid JSON, it returns a status code message or raw text.

Links and References

Discussion