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 Unique Visits" operation under the "Metrics API" resource fetches the number of unique users who viewed a selected page at least once during their session.

This node is beneficial for digital analysts, marketers, and product managers who want to understand user engagement on specific pages by tracking unique visits. For example, it can be used to measure the reach of a landing page or monitor traffic trends over time.

Properties

Name Meaning
Page Group ID The identifier of the page group for which to retrieve unique visit metrics. This is required.
Query Parameters Additional optional filters and parameters to refine the query results:
- Device: Filter by device type (All, Desktop, Mobile, Tablet)
- End Date: End date of the analysis range (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
- IDs: Comma-separated list of segment IDs to filter results
- Limit: Maximum number of results to return (default 50)
- Metric Type: Quantile or Average (default Quantile)
- Order: Ascending or Descending order of results (default Descending)
- Page: Page number of results to retrieve
- Period: Granularity of results (Daily or None; only for date ranges larger than one day)
- Project ID: Target project ID (required only for account-level API keys)
- Quantile: Percentile value if metric type is quantile (default 75)
- Scope: Filter based on scope
- Segment IDs: Multiple segments separated by commas for intersection metrics
- 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 JSON contains the response from the Contentsquare Metrics API endpoint for unique page visits. It typically includes data such as:

  • The count of unique users who visited the specified page group.
  • Associated metadata depending on the query parameters (e.g., date ranges, device types).
  • The structure depends on the API response but generally provides metrics aggregated per the requested filters.

If the API returns no content, the node outputs a status code indicating "204 No Content".

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential with client ID, client secret, and optionally project ID and scope for authentication.
  • The node performs OAuth2 client credentials flow to obtain an access token from Contentsquare.
  • Network access to https://api.contentsquare.com is required.
  • Proper configuration of the API credentials in n8n is necessary.

Troubleshooting

  • Missing Client ID or Client Secret: The node will throw an error if these credentials are not provided. Ensure that the API credentials are correctly set up.
  • Page Group ID Required: For this operation, the Page Group ID must be provided; otherwise, an error is thrown.
  • Failed to Retrieve Access Token or Endpoint: Indicates issues with authentication or API availability. Verify credentials and network connectivity.
  • API Errors: Any API call failure will result in an error message prefixed with "Error calling Contentsquare API". Check the error details for troubleshooting.
  • Invalid Query Parameters: Providing invalid or conflicting query parameters may cause API errors. Validate parameter values and formats.

Links and References

Discussion