Actions76
- Data Export API Actions
- Metrics API Actions
- Get Page Activity Rate
- Get Page Bounce Rate
- Get Page Conversion Rate
- Get Page Exit Rate
- Get Page Fold Height
- Get Page Height
- Get Page Interaction Time
- Get Page Landing Rate
- Get Page Scroll Rate
- Get Page Time Spent
- Get Page Unique Visits
- Get Page Views
- Get Page Views per Visit
- Get Page Visits
- Get Page Web Vitals
- Get Site Bounce Rate
- Get Site Cart Average
- Get Site Conversion Rate
- Get Site Conversions
- Get Site Pageview Average
- Get Site Revenue
- Get Site Session Time Average
- Get Site Visits
- Get Zone Attractiveness Rate
- Get Zone Click Rate
- Get Zone Click Recurrence
- Get Zone Conversion Rate per Click
- Get Zone Conversion Rate per Hover
- Get Zone Conversion Rate per Tap
- Get Zone Engagement Rate
- Get Zone Exposure Rate
- Get Zone Exposure Time
- Get Zone Hesitation Time
- Get Zone Hover Rate
- Get Zone Hover Time
- Get Zone Number of Clicks
- Get Zone Revenue
- Get Zone Revenue per Click
- Get Zone Revenue per Tap
- Get Zone Swipe Rate
- Get Zone Swipe Rate Recurrence
- Get Zone Tap Rate
- Get Zone Tap Recurrence
- Get Zone Time Before First Click
- Get Zone Time Before First Tap
- List Goals
- List Mappings
- List Page Groups
- List Page Groups Metrics
- List Segments
- List Site Metrics
- List Zone Metrics
- List Zones
- List Zonings
- Speed Analysis API Actions
Overview
This node integrates with the Contentsquare API to retrieve detailed user behavior and performance metrics related to website zones, pages, sites, and exports. Specifically, the "Get Zone Revenue" operation under the "Metrics API" resource fetches the total revenue generated by users segmented by their interaction with a specific zone (an element or area on a webpage). This is useful for understanding how different page elements contribute to revenue, enabling data-driven optimization of web layouts and marketing strategies.
Common scenarios include:
- Measuring the financial impact of clickable zones or interactive elements on a website.
- Analyzing revenue attribution to specific UI components or campaigns.
- Segmenting revenue data by device type, date ranges, or other filters to refine marketing efforts.
Example: A marketer wants to know how much revenue was generated from users who clicked on a promotional banner zone during a holiday campaign. Using this node, they can specify the zone ID and date range to get precise revenue metrics.
Properties
| Name | Meaning |
|---|---|
| Zone ID | Numeric identifier of the zone (page element) for which to retrieve revenue metrics. Required for this operation. |
| Query Parameters | Collection of optional filters and settings to refine the query results: |
| - Device | Filter by device type: All, Desktop, Mobile, Tablet. Default is All. |
| - End Date | End date of the analysis period (must be after Start Date). |
| - Format | Format of the query date range (string, usage depends on API specifics). |
| - Frequency | Filter based on export frequency (string). |
| - From | Filter based on export format (string). |
| - Goal ID | Numeric ID to return conversion metrics for a non-ecommerce goal. |
| - IDs | Comma-separated list of segment IDs to filter results. |
| - Limit | Maximum number of results to return. Default is 50. Minimum value is 1. |
| - Metric Type | Metric aggregation type: Quantile or Average. Default is Quantile. |
| - Order | Sort order of results: Ascending or Descending. Default is Descending. |
| - Page | Page number of results to retrieve (for pagination). |
| - Period | Granularity of results: Daily or None. Can only be used if date range is larger than one day. Default is None. |
| - Project ID | Target project ID (required only for account-level API keys). |
| - Quantile | Percentile to use if metric type is Quantile. Default is 75. Ignored if metric type is Average. |
| - Scope | Filter based on scope (string). |
| - Segment IDs | Numeric segment IDs separated by commas to retrieve metrics for intersection of specified segments. |
| - Start Date | Start date of the analysis period (must be before End Date). |
| - State | Filter based on status (string). |
| - To | End date of the query date range (string). |
Output
The node outputs an array of JSON objects representing the response from the Contentsquare API for the requested zone revenue metrics. The structure depends on the API response but typically includes fields such as:
- Total revenue generated by users interacting with the specified zone.
- Breakdown by time periods or segments if filters are applied.
- Additional metadata about the query or metrics.
If the API returns no content, the node outputs a status code message indicating "204 No Content".
No binary data output is indicated for this operation.
Dependencies
- Requires valid Contentsquare API credentials including Client ID, Client Secret, and optionally Project ID and Scope.
- The node performs OAuth2 client credentials flow to obtain an access token before making API requests.
- Network access to
https://api.contentsquare.comis required. - Proper configuration of credentials in n8n is necessary to authenticate API calls.
Troubleshooting
- Missing Credentials: If Client ID or Client Secret are not provided, the node throws an error "Missing Client ID or Client Secret."
- Access Token Retrieval Failure: If the OAuth token cannot be obtained, errors like "Failed to retrieve access token" or "Failed to retrieve endpoint" occur.
- Required Parameter Missing: For this operation, if Zone ID is not set, the node throws "Zone ID is required".
- API Errors: Any HTTP or API errors are caught and rethrown with the message prefix "Error calling Contentsquare API:" followed by the original error message.
- Invalid Query Parameters: Ensure date ranges are valid (startDate before endDate), numeric IDs are correct, and options conform to allowed values.
- Empty Response: If the API returns no data, the node outputs a "204 No Content" status; verify that the query parameters match existing data.