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. Specifically, the "List Zone Metrics" operation fetches various metrics for a specified zone within a web page or app interface, such as click rates, hover times, conversion rates, revenue generated, and more. This is useful for digital analysts, UX designers, and marketers who want to understand how users interact with specific areas ("zones") of their digital properties.

Common scenarios include:

  • Measuring user engagement on particular page elements.
  • Analyzing conversion rates linked to interactive zones.
  • Tracking revenue attribution per zone.
  • Monitoring exposure and interaction times to optimize UI/UX design.

For example, a marketer could use this node to get the click rate and conversion rate per click for a promotional banner zone to evaluate its effectiveness.

Properties

Name Meaning
Zone ID The unique identifier of the zone for which metrics are requested. This is required to specify the target zone.
Query Parameters A collection of optional filters and settings to refine the metrics query:
- Device: Filter by device type (All, Desktop, Mobile, Tablet).
- End Date: End date of analysis range.
- Format: Format of the query date range.
- Frequency: Export frequency filter.
- From: Export format filter.
- Goal ID: For conversion metrics of a non-ecommerce goal.
- IDs: Comma-separated segment IDs to filter results.
- Limit: Max number of results (default 50).
- Metric Type: Quantile or Average.
- Order: Ascending or Descending.
- Page: Page number of results.
- Period: Granularity of results (Daily or None).
- Project ID: Target project ID (required for account-level API keys).
- Quantile: Percentile used if metric type is quantile (default 75).
- Scope: Scope filter.
- Segment IDs: Multiple segments separated by commas for intersection.
- Start Date: Start date of analysis range.
- State: Status filter.
- To: End date of query date range.

Output

The output is a JSON array where each item corresponds to the response from the Contentsquare API for the requested zone metrics. The structure depends on the specific metrics queried but generally includes fields such as:

  • Metric values (e.g., click rate, hover time, conversion rate).
  • Associated metadata like timestamps, device types, or segment identifiers if filtered.
  • Pagination details if applicable.

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

The node does not output binary data; all responses are JSON-formatted metric data.

Dependencies

  • Requires an active Contentsquare API credential with:
    • Client ID
    • Client Secret
    • Optional Project ID and Scope
  • 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.

Troubleshooting

  • Missing Credentials: If Client ID or Client Secret is missing, the node throws an error "Missing Client ID or Client Secret."
  • Required Parameters Missing: For this operation, Zone ID must be provided; otherwise, an error "Zone ID is required" is thrown.
  • Access Token Retrieval Failure: If the OAuth token cannot be retrieved, errors "Failed to retrieve access token" or "Failed to retrieve endpoint" occur.
  • API Request Errors: Any HTTP or API errors are wrapped and reported with the message prefix "Error calling Contentsquare API".
  • Invalid Query Parameters: Ensure date ranges are valid (startDate before endDate), numeric fields are numbers, and enumerated options are correctly set.
  • Empty Responses: A "204 No Content" status indicates no data was returned for the query; verify filters and parameters.

Links and References

Discussion