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, zones, and site activity. Specifically, the "Get Zone Hover Rate" operation fetches the percentage of users who hovered over a particular zone at least once during their session. This metric helps understand user engagement with specific page elements.

Common scenarios for this node include:

  • Analyzing how users interact with different areas (zones) of a webpage.
  • Measuring engagement levels by tracking hover behavior on interactive elements.
  • Optimizing UI/UX by identifying zones that attract more user attention.

For example, a marketing analyst might use this node to determine which promotional banners receive the most user interest based on hover rates, helping to optimize placement or content.

Properties

Name Meaning
Zone ID The unique identifier of the zone for which the hover rate metric is requested. This is required to specify the target zone.
Query Parameters A collection of optional filters and settings to refine the data retrieval:
- Device: Filter results 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 related to a non-ecommerce goal.
- IDs: Comma-separated list of segment IDs to filter.
- Limit: Maximum number of results to return (default 50).
- Metric Type: Choose between Quantile or Average (default Quantile).
- Order: Sort order Ascending or Descending (default 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, Segment IDs, Start Date, State, To: Additional filters for scope, segments, date range, status, and end date respectively.

Output

The output is a JSON array containing the response from the Contentsquare Metrics API for the zone hover rate. The structure typically includes:

  • Metrics related to the hover rate of the specified zone, such as the percentage of users who hovered over it.
  • Additional metadata depending on the query parameters and API response.

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

The node does not output binary data.

Dependencies

  • Requires an API key credential with Client ID, Client Secret, Project ID, and Scope configured in n8n credentials.
  • The node authenticates via OAuth2 client credentials flow to obtain an access token before making API requests.
  • The base URL endpoint for the API is dynamically retrieved upon authentication.

Troubleshooting

  • Missing Credentials: If Client ID or Client Secret are missing, the node throws an error "Missing Client ID or Client Secret." Ensure these are correctly set in the credentials.
  • Access Token Retrieval Failure: Errors like "Failed to retrieve access token" or "Failed to retrieve endpoint" indicate issues with authentication. Verify API credentials and permissions.
  • Required Parameter Missing: If the Zone ID is not provided when calling the "Get Zone Hover Rate" operation, the node throws "Zone ID is required". Make sure to provide this parameter.
  • API Request Errors: Any other errors returned by the API will be wrapped and shown as "Error calling Contentsquare API" with details. Check the API documentation and ensure all parameters are valid.
  • Empty Response: A "204 No Content" status means no data was found for the given parameters. Adjust filters or date ranges accordingly.

Links and References

Discussion