Contentsquare icon

Contentsquare

Use the Contentsquare API

Actions76

Overview

This node integrates with the Contentsquare API to retrieve detailed metrics about user behavior and site performance. Specifically, the "Get Site Revenue" operation under the "Metrics API" resource fetches the total revenue generated by all transactions on a website within a specified date range and other optional filters.

This node is beneficial for digital analysts, marketers, and e-commerce managers who want to automate the extraction of key performance indicators such as site revenue directly into their workflows. For example, it can be used to pull daily or monthly revenue data for reporting dashboards or trigger alerts when revenue drops below a threshold.

Properties

Name Meaning
Device Filter results by device type: All, Desktop, Mobile, or Tablet.
End Date The end date of the analysis period (must be after the start date).
Format Format filter for the query (specific usage depends on API).
Frequency Filter based on export frequency.
From Filter based on export format.
Goal ID Specify a non-ecommerce goal ID to return conversion metrics related to that goal.
IDs Comma-separated list of segment IDs to filter results by matching segments.
Limit Maximum number of results to return (minimum 1, default 50).
Metric Type Choose between "Quantile" (default 75th percentile) or "Average" metric types.
Order Sort order of results: Ascending or Descending (default Descending).
Page Page number of results to retrieve (for pagination).
Period Granularity of results: Daily or None (default None). Can only be used if the date range is larger than one day.
Project ID Target project ID (required only for account-level API keys).
Quantile Percentile value used if metric type is Quantile (default 75). Ignored if metric type is Average.
Scope Filter based on scope (API-specific meaning).
Segment IDs Multiple segment IDs separated by commas to get metrics for the intersection of these segments.
Start Date The start date of the analysis period (must be before the end date).
State Filter based on status (API-specific meaning).
To Alias for end date of the query date range.

Output

The output JSON contains the response from the Contentsquare Metrics API endpoint for site revenue. This typically includes aggregated revenue data over the requested time frame and filtered by the provided parameters. The exact structure depends on the API response but generally includes fields such as:

  • Total revenue amount.
  • Breakdown by date or other dimensions if granularity is specified.
  • Metadata about the query like applied filters and pagination info.

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 with access to the Contentsquare API.
  • Network access to https://api.contentsquare.com is required.

Troubleshooting

  • Missing Credentials: If the Client ID or Client Secret is not set, the node will throw an error indicating missing credentials.
  • Invalid or Expired Token: Failure to retrieve an access token will cause an error; ensure credentials are correct and have proper permissions.
  • Required Parameters Missing: Some operations require mandatory parameters (e.g., Page Group ID for page-related metrics). Omitting these will result in errors specifying which parameter is missing.
  • API Endpoint Errors: If the API returns an error, the node will throw an error including the message from the API. Check the request parameters and API limits.
  • Date Range Issues: Ensure that the start date is before the end date; otherwise, the API may reject the request.

Links and References

Discussion