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 Views per Visit" operation under the "Metrics API" resource fetches the average number of times a particular page is viewed during a single visit. This metric helps understand user engagement by showing how often visitors return to or refresh a page within their session.

Common scenarios where this node is beneficial include:

  • Analyzing user engagement on specific pages to optimize content or layout.
  • Monitoring page popularity and repeat views to identify potential issues or interests.
  • Comparing page views per visit across different devices or segments for targeted marketing.

For example, a digital marketer might use this node to track how many times users view a product page per visit, helping to assess interest levels or detect navigation difficulties.

Properties

Name Meaning
Page Group ID The identifier of the page group for which the metric is requested. This is required to specify the target page group in the query.
Query Parameters A collection of optional filters and settings to refine the data retrieval. Options include:
- Device: Filter by device type (All, Desktop, Mobile, Tablet)
- Start Date / End Date: Define date range
- Limit: Max results to return
- Metric Type: Quantile or Average
- Order: Ascending or Descending
- Period: Granularity (Daily or None)
- Project ID: Target project for account-level API keys
- Segment IDs: Filter by segments
- Other filters like Goal ID, Scope, State, etc.

Output

The output is a JSON array containing the response from the Contentsquare API for the requested metric. The structure typically includes statistical data about page views per visit for the specified page group and filters. The exact fields depend on the API response but generally provide numeric values representing averages or quantiles over the selected period.

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 before making API requests.
  • Network access to https://api.contentsquare.com is necessary.
  • Proper configuration of the API credentials in n8n is mandatory.

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.
  • Missing Required Parameters: 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: If the API returns errors, they are wrapped and presented as node errors with messages indicating the problem.
  • Empty or Unexpected Responses: Check the query parameters and ensure the date ranges and filters are valid and that data exists for the specified criteria.

Links and References

Discussion