Contentsquare icon

Contentsquare

Use the Contentsquare API

Actions76

Overview

This node integrates with the Contentsquare API to retrieve detailed user behavior and performance metrics related to website zones, pages, sites, and speed analysis. Specifically, for the Metrics API resource and the Get Zone Time Before First Click operation, it fetches the number of seconds elapsed between page load and the first click on a specified zone element.

This is useful in scenarios where you want to analyze user engagement timing on specific interactive areas (zones) of a webpage. For example, marketers or UX analysts can measure how quickly users interact with key call-to-action buttons or promotional banners after the page loads, helping optimize layout and content placement.

Properties

Name Meaning
Zone ID The unique identifier of the zone (interactive area) on the page for which the metric is requested. This is required to specify the target zone.
Query Parameters A collection of optional filters and parameters to refine the query results:
- Device: Filter by device type (All, Desktop, Mobile, Tablet).
- Start Date / End Date: Define the date range for analysis.
- Format, Frequency, From, To: Various export and filtering options.
- Goal ID: Specify a non-ecommerce goal for conversion metrics.
- IDs, Segment IDs: Filter by segment identifiers.
- Limit, Page: Pagination controls.
- Metric Type: Choose between Quantile or Average.
- Order: Ascending or Descending result order.
- Period: Granularity of results (Daily or None).
- Project ID: Target project identifier (required for account-level API keys).
- Quantile: Percentile value used if metric type is Quantile (default 75).
- Scope, State: Additional filtering options based on status or scope.

Output

The output is a JSON array containing the response from the Contentsquare Metrics API endpoint for the zone time before first click metric. The structure typically includes:

  • Numeric values representing the time in seconds between page load and the first click on the specified zone.
  • Possibly additional metadata depending on the query parameters and API response format.

If the API returns no content, the node outputs a status message indicating "204 No Content".

No binary data output is involved in this operation.

Dependencies

  • Requires an API authentication token obtained via OAuth2 client credentials flow using:
    • Client ID
    • Client Secret
    • Optional Project ID and Scope
  • The node makes HTTP requests to the Contentsquare API endpoints.
  • Proper n8n credential configuration for the Contentsquare API is necessary.

Troubleshooting

  • Missing Credentials: If Client ID or Client Secret are not provided, the node throws an error "Missing Client ID or Client Secret."
  • Required Parameters Missing: For this operation, if the Zone ID is not set, the node will throw an error "Zone ID is required."
  • Failed Token Retrieval: Errors like "Failed to retrieve access token" or "Failed to retrieve endpoint" indicate issues with authentication or API availability.
  • API Request Errors: Any HTTP or network errors during the API call will be wrapped and reported as "Error calling Contentsquare API" with details.
  • Invalid Query Parameters: Providing invalid or conflicting query parameters may cause the API to return errors or empty results.

To resolve these issues:

  • Ensure all required credentials and parameters are correctly configured.
  • Verify that the API credentials have appropriate permissions.
  • Check network connectivity and API endpoint availability.
  • Validate query parameter values and formats.

Links and References

Discussion