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 "List Page Groups Metrics" operation under the "Metrics API" resource fetches various metrics for page groups within a specified date range and according to optional filters.

Use cases include:

  • Analyzing user engagement and interaction on specific page groups.
  • Monitoring key performance indicators like bounce rate, conversion rate, scroll rate, and time spent on pages.
  • Filtering metrics by device type, date ranges, segments, and other parameters to gain granular insights.
  • Automating reporting workflows that require up-to-date page group metrics from Contentsquare.

Example: Retrieve the bounce rate and unique visits for a particular page group over the last month filtered by mobile devices.

Properties

Name Meaning
Page Group ID The identifier of the page group for which metrics are requested. This is required for most page group metric operations.
Query Parameters A collection of optional filters and settings to refine the metrics query:
- Device: Filter by device type (All, Desktop, Mobile, Tablet).
- Start Date / End Date / To / From: Define the date range.
- Limit: Max number of results to return.
- Metric Type: Quantile or Average.
- Order: Ascending or Descending.
- Page: Pagination page number.
- Period: Granularity of results (Daily or None).
- Project ID: Target project identifier (required for account-level API keys).
- Goal ID: For conversion metrics related to non-ecommerce goals.
- IDs, Segment IDs: Filters for segments.
- Quantile: Percentile used if metric type is quantile (default 75).
- Scope, State, Frequency, Format: Additional filtering options based on export format, frequency, status, and scope.

Output

The output is a JSON array where each element corresponds to the response data returned by the Contentsquare API for the requested metrics. The structure depends on the specific metric queried but generally includes:

  • Metric values (e.g., bounce rate, conversion rate, views).
  • Associated metadata such as timestamps, segment identifiers, or device types if applicable.
  • Pagination information if multiple pages of results are returned.

No binary data output is produced by this operation.

Dependencies

  • Requires an API authentication token obtained via OAuth2 client credentials flow using a Client ID and Client Secret.
  • The node expects valid credentials configured in n8n containing these authentication details.
  • Network access to the Contentsquare API endpoint is necessary.
  • Proper permissions/scopes must be granted to the API credentials to access the Metrics API.

Troubleshooting

  • Missing Required IDs: If the Page Group ID or other required IDs (like Zone ID or Mapping ID) are not provided when needed, the node throws an error indicating the missing parameter.
  • Authentication Failures: Errors retrieving the access token or endpoint indicate invalid or missing client credentials.
  • Invalid Query Parameters: Providing incorrect date ranges (e.g., endDate before startDate) or unsupported filter values may cause API errors.
  • API Rate Limits or Network Issues: Temporary failures calling the API might occur; retrying or checking network connectivity can help.
  • Unexpected Response Format: If the API returns a string instead of JSON, the node attempts to parse it; failure to parse will return raw text.

To resolve errors:

  • Ensure all required input properties are set correctly.
  • Verify API credentials and their scopes.
  • Confirm date ranges and filter values are valid.
  • Check network connectivity and API service status.

Links and References

Discussion