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 web pages. Specifically, the "Get Page Fold Height" operation under the "Metrics API" resource fetches the average screen height (fold height) for a specified page group. This metric helps understand how much of a webpage is visible without scrolling, which is valuable for optimizing content placement and improving user experience.

Common scenarios where this node is beneficial include:

  • Analyzing how users view different parts of a webpage across devices.
  • Optimizing webpage layout by understanding typical viewport heights.
  • Comparing fold heights over time or between segments to assess design changes impact.

Example: A digital marketer wants to know the average fold height on their landing page to ensure key call-to-action buttons are visible without scrolling on most devices.

Properties

Name Meaning
Page Group ID Numeric identifier of the page group for which the fold height metric is requested. This is required to specify the target page group.
Query Parameters 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: Maximum 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 identifier.
- Quantile: Percentile value if metric type is quantile (default 75).
- Scope, Segment IDs, Start Date, State, To: Additional filtering options.

Output

The output is a JSON array containing the response from the Contentsquare API for the requested fold height metric. The structure typically includes:

  • Metric values representing the average fold height (screen height) for the specified page group.
  • Metadata about the query such as timestamps, device types, or segmentation if applied.

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 a Client ID and Client Secret.
  • Needs a valid Contentsquare API endpoint URL returned during authentication.
  • Requires configuration of an API key credential in n8n with appropriate permissions to access the Metrics API.
  • Network connectivity to https://api.contentsquare.com.

Troubleshooting

  • Missing Client ID or Client Secret: The node will throw an error if these credentials are not provided. Ensure that the API credentials are correctly configured.
  • Failed to retrieve access token or endpoint: Indicates issues with authentication; verify credentials and network access.
  • Required parameter missing: For this operation, "Page Group ID" must be provided; otherwise, an error is thrown.
  • API errors: Any HTTP or API-specific errors are wrapped and reported with messages prefixed by "Error calling Contentsquare API".
  • Empty or malformed responses: If the API returns empty or non-JSON responses, the node attempts to handle them gracefully but may output raw text or status codes.

Links and References

Discussion