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 Exit Rate" operation fetches the ratio of page views that were the last in a visitor's session compared to the total number of views for that page group. This metric helps understand how often users leave a site from a particular page, which is valuable for identifying potential issues or drop-off points in user journeys.

Common scenarios where this node is beneficial include:

  • Analyzing exit rates on key landing pages to optimize content or calls to action.
  • Monitoring exit rates over time to detect changes after website updates.
  • Segmenting exit rate data by device type or date range to better understand user behavior patterns.

Example: A marketing analyst could use this node to get the exit rate for a product page group over the last month filtered by mobile devices to assess if mobile users are leaving prematurely.

Properties

Name Meaning
Page Group ID The identifier of the page group for which the exit rate metric is requested. This is required to specify the target page group.
Query Parameters A collection of optional filters and settings to refine the query results:
- Device: Filter by device type (All, Desktop, Mobile, Tablet).
- End Date: End of the date range.
- Format: Start date of the query range.
- Frequency: Export frequency filter.
- From: Export format filter.
- Goal ID: For conversion metrics of non-ecommerce goals.
- IDs: Comma-separated segment IDs to filter.
- Limit: Max number of results (default 50).
- Metric Type: Quantile or Average.
- Order: Ascending or Descending.
- Page: Pagination page number.
- 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 filtering options.

Output

The output is a JSON array containing the response data from the Contentsquare Metrics API for the page exit rate. The structure depends on the API response but typically includes metrics such as:

  • The exit rate value(s) for the specified page group.
  • Associated metadata like timestamps, segments, or device filters applied.

If the API returns no content, the node outputs a status code 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.
  • Network access to https://api.contentsquare.com is necessary.

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.
  • Missing Page Group ID: This parameter is mandatory for the "Get Page Exit Rate" operation. If omitted, the node throws an error.
  • Failed to retrieve access token or endpoint: Indicates issues with authentication; verify credentials and network connectivity.
  • API errors: Any HTTP or API-specific errors are wrapped and reported with messages starting with "Error calling Contentsquare API". Check the message and stack trace for details.
  • Empty or malformed responses: The node attempts to parse string responses as JSON; if parsing fails, it returns raw text. Verify API response formats and parameters.

Links and References

Discussion