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 exports. Specifically, for the Metrics API resource and the Get Zone Engagement Rate operation, it fetches the percentage of visitors who clicked on a zone after having hovered over it. This metric helps understand how engaging a particular interactive area (zone) on a webpage is.

Common scenarios where this node is beneficial include:

  • Analyzing user engagement on specific page elements to optimize UI/UX.
  • Measuring effectiveness of interactive zones in driving user actions.
  • Comparing engagement rates across different devices or time periods.
  • Integrating Contentsquare metrics into automated workflows or dashboards.

Example use case: A marketing analyst wants to track how many users hover over a promotional banner zone and then click it, segmented by device type and date range, to evaluate campaign effectiveness.

Properties

Name Meaning
Zone ID The unique identifier of the zone for which the engagement rate metric is requested. This is required to specify the target zone.
Query Parameters Optional filters and parameters to refine the query results. These include:
- Device: Filter by device type (All, Desktop, Mobile, Tablet).
- Start Date / End Date: Define the analysis date range.
- Limit: Max number of results.
- Metric Type: Quantile or Average.
- Order: Ascending or Descending.
- Page: Pagination.
- Period: Granularity (Daily or None).
- Project ID: Target project for account-level API keys.
- Goal ID, Segment IDs, Scope, State, Format, Frequency, From, To, IDs: Various additional filters to customize the data returned.

Output

The node outputs the JSON response from the Contentsquare Metrics API endpoint for zone engagement rate. The structure typically includes metrics data such as:

  • Engagement rate values (percentage of visitors clicking after hovering).
  • Associated metadata like timestamps, device types, segments, or other filters applied.

If the API returns no content, the output will indicate a "204 No Content" status.

No binary data output is involved in this operation.

Dependencies

  • Requires an API key credential with valid Client ID, Client Secret, and optionally Project ID and scope for authentication.
  • The node performs OAuth2 client credentials flow to obtain an access token before making API requests.
  • Network access to https://api.contentsquare.com is necessary.
  • Proper configuration of the credential in n8n with the required fields is essential.

Troubleshooting

  • Missing Client ID or Client Secret: The node throws an error if these are not provided in credentials. Ensure credentials are correctly set up.
  • Zone ID Required: For this operation, the Zone ID must be specified; otherwise, an error is thrown.
  • Failed to Retrieve Access Token or Endpoint: Indicates issues with authentication or API availability.
  • API Errors: Any HTTP or API errors are caught and reported with descriptive messages.
  • Empty or Unexpected Response: If the API returns empty or non-JSON responses, the node attempts to parse or returns a no-content status.

To resolve common errors:

  • Verify credentials and permissions.
  • Confirm that the Zone ID exists and is correct.
  • Check network connectivity and API service status.
  • Review query parameters for correctness and compatibility.

Links and References

Discussion