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, the "Get Zone Attractiveness Rate" operation fetches the percentage of page views where at least one user selected (interacted with) a particular zone out of all views where that zone was displayed.

This node is beneficial for digital analysts and marketers who want to understand how attractive or engaging specific areas ("zones") of their web pages are to visitors. For example, it can help identify which parts of a webpage draw user attention and interaction, enabling optimization of layout or content placement.

Practical examples:

  • Measuring the attractiveness rate of a promotional banner zone on an e-commerce site.
  • Comparing engagement across different zones on a landing page to optimize call-to-action placements.
  • Tracking changes in zone attractiveness over time after UI updates.

Properties

Name Meaning
Zone ID The unique identifier of the zone for which the attractiveness rate 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).
- End Date: End date of analysis range.
- Format: Format of the query.
- Frequency: Export frequency filter.
- From: Export format filter.
- Goal ID: Conversion goal identifier.
- IDs: Comma-separated list of segment IDs.
- Limit: Max number of results (default 50).
- Metric Type: Quantile or Average.
- Order: Ascending or Descending.
- Page: Page number of results.
- Period: Granularity (Daily or None).
- Project ID: Target project ID (for account-level API keys).
- Quantile: Percentile value if metric type is quantile (default 75).
- Scope: Scope filter.
- Segment IDs: Multiple segments separated by commas.
- Start Date: Start date of analysis range.
- State: Status filter.
- To: End date of query range.

Output

The output is a JSON array containing the response from the Contentsquare API for the zone attractiveness rate metric. The structure depends on the API's response but typically includes:

  • Metrics data about the attractiveness rate of the specified zone.
  • May include timestamps, device breakdowns, segmentation details, and other metadata depending on query parameters.

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

No binary data output is produced by this operation.

Dependencies

  • Requires valid credentials with a Client ID, Client Secret, and optionally Project ID and scope for the Contentsquare API.
  • 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 API credential in n8n is required.

Troubleshooting

  • Missing Client ID or Client Secret: The node will throw an error if these credentials are not provided. Ensure your API credentials are correctly configured.
  • Zone ID is required: If the Zone ID property is empty when calling the zone-related metrics, the node throws an error. Provide a valid Zone ID.
  • Failed to retrieve access token or endpoint: Indicates issues with authentication or API availability. Verify credentials and network connectivity.
  • API errors: Any HTTP or API errors are wrapped and reported with messages starting with "Error calling Contentsquare API". Check the API documentation and ensure query parameters are valid.
  • Empty or malformed responses: The node attempts to parse string responses as JSON; if parsing fails, raw text is returned. Confirm the API response format matches expectations.

Links and References

Discussion