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 "List Zonings" operation under the "Metrics API" resource fetches all zonings associated with a given page group. Zonings represent logical groupings or layouts of zones (interactive areas) on a webpage, useful for analyzing user interactions within specific page sections.

Common scenarios where this node is beneficial include:

  • Analyzing how different parts of a webpage perform in terms of user engagement.
  • Preparing data for further analysis of zone-level metrics like clicks, hovers, or conversions.
  • Automating reporting workflows that require up-to-date zoning information for specific page groups.

Example use case:

  • A digital analyst wants to list all zonings for a particular page group to understand how the page layout affects user behavior. They provide the Page Group ID and optionally filter results using query parameters such as date ranges or device types.

Properties

Name Meaning
Page Group ID The identifier of the page group for which to list zonings. This is required for this operation.
Query Parameters Optional filters to refine the request results. Available options include:
- Device: Filter by device type (All, Desktop, Mobile, Tablet).
- End Date: End of the date range for analysis (must be after start date).
- Format: Start date of the query date range (string format).
- Frequency: Filter based on export frequency.
- From: Filter based on export format.
- Goal ID: Return conversion metrics for a non-ecommerce goal (number).
- IDs: Comma-separated list of segment IDs to filter results.
- Limit: Maximum number of results to return (default 50).
- Metric Type: Quantile or Average (default Quantile).
- Order: Ascending or Descending order of results (default Descending).
- Page: Page number of results to retrieve.
- Period: Granularity of results (Daily or None; only for date ranges larger than one day).
- Project ID: Target project ID (required only for account-level API keys).
- Quantile: Percentile value if metric type is Quantile (default 75).
- Scope: Filter based on scope (string).
- Segment IDs: Multiple segments separated by commas for intersection filtering.
- Start Date: Beginning of date range for analysis (must be before end date).
- State: Filter based on status (string).
- To: End date of the query date range (string).

Output

The output is a JSON array where each item corresponds to a zoning object retrieved from the Contentsquare API for the specified page group. Each zoning object typically contains details such as zoning identifiers, names, and possibly metadata describing the zones included.

If the API returns no content, the node outputs an object indicating "204 No Content".

No binary data output is involved in this operation.

Dependencies

  • Requires an API key credential with client ID, client secret, and optionally project ID and scope for authentication.
  • The node performs OAuth2 client credentials flow to obtain an access token from Contentsquare.
  • Network access to https://api.contentsquare.com is necessary.
  • Proper configuration of the API credentials in n8n is required.

Troubleshooting

  • Missing Page Group ID: The node throws an error if the Page Group ID is not provided for this operation. Ensure this property is set.
  • Authentication Errors: If client ID or client secret are missing or invalid, the node will fail to retrieve an access token.
  • API Endpoint Issues: Failure to retrieve the API endpoint URL from the token response will cause errors.
  • Invalid Query Parameters: Providing incorrectly formatted dates or unsupported parameter values may result in API errors.
  • Empty Responses: If no zonings exist for the given page group, the node returns a "204 No Content" status object.
  • Network or API Errors: Any HTTP or network issues during the API call will be reported as node API errors with descriptive messages.

Links and References

  • Contentsquare API Documentation (general reference for API endpoints and parameters)
  • OAuth2 Client Credentials Flow (standard OAuth2 mechanism used for authentication)

Discussion