Skip to main content

Fetching Organization Information

To retrieve your organization information and available frontends:
The sites array contains your frontend information (frontendIds), which you’ll need when querying statistics data.

Fetching Definitions

To retrieve the available metrics, dimensions, and attributionModels for your organization:
These definitions can be used to construct your statistics queries by selecting the metrics and dimensions to use in your query.

Fetching Statistics Data

The insights query allows you to retrieve aggregated statistics based on selected dimensions and metrics:
Example Variables
The insightsParams object accepts the following parameters:
  • frontendIds (array of strings): List of frontend IDs to query data for
  • startDate (ISO 8601 string): Start date for the data range
  • endDate (ISO 8601 string): End date for the data range
  • dimensions (array of strings): Dimensions to group data by (e.g., channelGroup, channel, product)
  • metrics (array of strings): Metrics to retrieve (e.g., session:count, session:duration, product:inventoryValue)
  • filter (object): Optional filters to apply to the data
  • compareStartDate (ISO 8601 string, optional): Start date for comparison period
  • compareEndDate (ISO 8601 string, optional): End date for comparison period
  • aggregateDimensions (array of strings, optional): Additional dimensions for aggregation (e.g., day, week, month)

Pagination

The insights endpoint supports pagination through the pageInfo object in the response:
  • pageSize: Number of records per page
  • offset: Current offset for pagination
  • hasNextPage: Boolean indicating if more data is available
For large datasets, we recommend using paginated queries to efficiently retrieve all data. Implement pagination logic in your client to fetch all pages when hasNextPage is true.

Complete cURL Example

Here’s a complete example of how to make a request using cURL:

Integration Tips

  • Error Handling: Implement proper error handling for authentication failures, rate limits, and query errors
  • Caching: Consider caching frequently accessed data to reduce API calls and improve performance
  • Date Formats: Always use ISO 8601 format for dates (e.g., 2025-11-02T23:00:00.000Z)
  • Frontend IDs: Use the OrganizationInfoQuery to programmatically retrieve your frontend information (frontendIds)