Contentsquare icon

Contentsquare

Use the Contentsquare API

Actions76

Overview

This node integrates with the Contentsquare API, enabling users to access various analytics and performance data related to user behavior on websites or apps. It supports three main API categories:

  • Data Export API: Manage export jobs and retrieve export-related data.
  • Metrics API: Fetch detailed metrics about user interactions, page performance, site statistics, zones (interactive areas), segments, goals, and more.
  • Speed Analysis API: Create and manage speed analysis events, reports, and monitoring for web pages.

Typical use cases include automating the retrieval of user engagement metrics, exporting large datasets for offline analysis, monitoring website speed and performance, and integrating Contentsquare insights into broader workflows.

For example, a marketing analyst could use this node to automatically fetch daily page views and conversion rates, while a developer might automate speed monitoring reports to detect regressions in web performance.

Properties

Name Meaning
Query Parameters A collection of optional filters and parameters to customize the API request. Includes options such as: Device (All, Desktop, Mobile, Tablet), date ranges (startDate, endDate), format, frequency, goalId, limit, order, period, projectId, quantile, scope, segmentIds, state, etc.
These parameters allow fine-tuning of the data retrieved from the API, such as filtering by device type, specifying date ranges, limiting results, and selecting metric types (Quantile or Average).

Note: The full list of query parameters is extensive and includes fields like device, endDate, format, frequency, goalId, ids, limit, metricType, order, page, period, projectId, quantile, scope, segmentIds, startDate, state, and to.

Output

The node outputs JSON data representing the response from the Contentsquare API based on the selected resource and operation. The structure varies depending on the endpoint called but generally includes:

  • Lists of metrics, jobs, runs, variables, goals, mappings, pages, zones, segments, or reports.
  • Detailed metric values such as page activity rate, bounce rate, conversion rate, zone click rate, revenue, session times, and many others.
  • Status codes or messages when no content is returned.

If the API returns a string response, the node attempts to parse it as JSON; otherwise, it outputs the raw text or a status message indicating no content.

The node does not output binary data.

Dependencies

  • Requires an API authentication token obtained via OAuth 2.0 client credentials flow using:
    • Client ID
    • Client Secret
    • Optional Project ID and Scope
  • The node makes HTTP requests to the Contentsquare API endpoints.
  • Users must configure appropriate credentials in n8n containing these authentication details.

Troubleshooting

  • Missing Credentials: If the Client ID or Client Secret is missing, the node throws an error "Missing Client ID or Client Secret." Ensure credentials are correctly set up.
  • Access Token Retrieval Failure: Errors like "Failed to retrieve access token" or "Failed to retrieve endpoint" indicate issues during OAuth token acquisition. Verify credentials and network connectivity.
  • Required Parameter Missing: Many operations require specific IDs (e.g., Job ID, Page Group ID, Zone ID). If these are not provided, the node throws errors such as "Job ID is required" or "Zone ID is required." Provide all mandatory parameters.
  • Unknown Resource: If an unsupported resource is specified, the node throws "Unknown resource" error.
  • API Errors: Any API call failure will result in an error prefixed with "Error calling Contentsquare API," including the original message and stack trace if available.
  • Empty or Unexpected Responses: If the API returns empty or non-JSON responses, the node handles them gracefully but verify that the API endpoint and parameters are correct.

Links and References


This summary covers the default resource and operation logic of the Contentsquare node as implemented in the provided source code and property definitions.

Discussion