Contentsquare icon

Contentsquare

Use the Contentsquare API

Actions76

Overview

This node integrates with the Contentsquare API to retrieve detailed user behavior and performance metrics for websites or applications. Specifically, the "Get Site Conversion Rate" operation fetches the ratio of sessions where a specified goal was reached compared to the total number of sessions on the site. This metric is useful for understanding how effectively a website converts visitors into customers or leads.

Common scenarios include:

  • Measuring the effectiveness of marketing campaigns by tracking conversion rates over time.
  • Analyzing user engagement and goal completions on different devices or segments.
  • Comparing conversion rates across date ranges or filtered by specific criteria such as device type or user segments.

Example: A digital marketer can use this node to automatically pull daily site conversion rates filtered by mobile users to monitor campaign performance on mobile devices.

Properties

Name Meaning
Device Device filter for analysis. Options: All, Desktop, Mobile, Tablet
End Date End of date range for analysis (must be after Start Date)
Format Start date of the query date range
Frequency Filter based on export frequency
From Filter based on export format
Goal ID Return conversion metrics for a non-ecommerce goal (numeric ID)
IDs Filter results by segment IDs (comma-separated list)
Limit Maximum number of results to return (minimum 1, default 50)
Metric Type Metric calculation type. Options: Quantile, Average
Order Order of results list. Options: Ascending, Descending
Page Page number of results to retrieve
Period Granularity of results. Options: Daily, None
Project ID Target project ID (required only for account-level API key)
Quantile Percentile used if metric type is Quantile (default 75, ignored if Average)
Scope Filter based on scope
Segment IDs Multiple segments separated by commas to get intersection metrics (numeric)
Start Date Beginning of date range for analysis (must be before End Date)
State Filter based on status
To End date of the query date range

Output

The output is a JSON array containing the response from the Contentsquare Metrics API for the site conversion rate query. The structure depends on the API response but typically includes fields such as:

  • Conversion rate values (ratio or percentage)
  • Associated metadata like date ranges, segments, or device filters applied
  • Pagination details if multiple pages of results are returned

No binary data is output by this node.

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 these parameters.
  • Network access to the Contentsquare API endpoint is required.
  • The node uses standard HTTP methods (GET/POST) to interact with the API.

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 retrieved, errors "Failed to retrieve access token" or "Failed to retrieve endpoint" occur.
  • Required Parameter Missing: For this operation, if required parameters like Project ID or date ranges are missing or invalid, the node will throw errors indicating which parameter is required.
  • API Errors: Any API call failure returns an error prefixed with "Error calling Contentsquare API:" followed by the message. Check API limits, permissions, and parameter correctness.
  • Invalid Date Ranges: Ensure that startDate is before endDate; otherwise, the API may reject the request.

Links and References

Discussion