Piano Analytics icon

Piano Analytics

Use the Piano Analytics API

Actions6

Overview

This node integrates with the Piano Analytics API, specifically supporting multiple resources including the Extraction API. For the Extraction API resource and the Get Row Count operation, it retrieves the number of results matching a specified query from Piano Analytics data.

This is useful when you want to quickly determine how many rows of data match certain criteria without fetching the full dataset. For example, before paginating through large datasets, you might want to know the total count of matching records to control your workflow logic or UI display.

Practical examples:

  • Counting the number of visits or events in a given period for specific sites.
  • Determining how many rows will be returned by a complex query before retrieving detailed data.
  • Validating if any data exists for a particular filter or segment.

Properties

Name Meaning
Sites Comma-separated list of site IDs to query (e.g., "123,456").
Columns Comma-separated list of columns/metrics/dimensions to retrieve counts for (e.g., "visits,pageviews").
Period JSON object defining the time period for the query (e.g., {"start":"2023-01-01","end":"2023-01-31"}).
Optional Parameters Collection of optional JSON parameters to refine the query:
- Evolution JSON defining evolution parameters (e.g., comparison periods).
- Filter JSON filter criteria to narrow down the data.
- Options Additional options as JSON to customize the query behavior.
- Segment JSON segment definition to apply segmentation on the data.

Output

The output is a JSON array where each item corresponds to the response from the Piano Analytics API for the row count request. The structure typically contains the count of rows matching the query criteria.

Example output JSON snippet:

[
  {
    "rowCount": 1234
  }
]

If no content is returned, the node outputs an object with "Status Code": "204 No Content" indicating no matching data was found.

Dependencies

  • Requires an API key credential for authenticating with the Piano Analytics API.
  • The node makes HTTP POST requests to the endpoint https://api.atinternet.io/v3/data/getRowCount.
  • The user must provide valid site IDs, columns, and period parameters.
  • Proper JSON formatting is required for period and optional parameters inputs.

Troubleshooting

  • Missing Credentials Error: If the API credentials are not set or invalid, the node throws an error "Missing Piano Analytics API Credentials". Ensure that a valid API key credential is configured.
  • Required Parameter Errors: The node validates presence of required fields like Columns, Period, and Sites. Missing these will cause errors such as "Columns is required". Double-check all mandatory inputs.
  • Invalid JSON Format: Inputs like Period and optional parameters expect valid JSON. Malformed JSON will cause parsing errors. Use proper JSON syntax.
  • Unknown Operation or Resource: If an unsupported operation or resource is selected, the node throws an error indicating the unknown value. Verify the correct operation/resource combination.
  • API Request Failures: Network issues or incorrect API keys can cause request failures. The node surfaces API error messages prefixed with "Error calling Piano Analytics API". Check network connectivity and API key validity.

Links and References

Discussion