Overview
ThegetAnalytics query provides comprehensive business intelligence data across multiple dimensions including sales performance, inventory levels, customer behavior, order status, and shipping metrics.
GraphQL Query
Time period for analytics data. Options: “24h”, “7d”, “30d”, “90d”. Default: “7d”
Response Structure
Returns a comprehensive JSON object with analytics across multiple categories:Sales Metrics
Overall sales performance metrics
Total revenue including all fees
Revenue from products only (excluding tax and shipping)
Total shipping charges
Total tax collected
Total discounts applied
Total amount refunded
Number of orders
Average order value (total / count)
Inventory Metrics
Product inventory and performance data
Total number of products
Number of products completely out of stock
Number of products with low inventory (< 10 units)
Total inventory value (quantity × price)
Total units in stock across all products
Customer Metrics
Customer acquisition and behavior data
Total number of registered customers
New customers in selected timeframe
Customers who made purchases in timeframe
Average customer lifetime value
Order Metrics
Order status and processing data
Total number of orders
Order count by status (pending, processing, completed, canceled, etc.)
Order count by fulfillment status (unfulfilled, fulfilled, etc.)
Order count by payment status (pending, captured, refunded, etc.)
Daily order metrics (same structure as sales.timeline)
Shipping Metrics
Example Query
Example Response
Use Cases
Dashboard Overview
Retrieve key metrics for a business dashboard:Monthly Report
Generate a comprehensive monthly business report:Real-time Monitoring
Monitor today’s performance:Data Source
The analytics query aggregates data from:- Orders: Status, totals, line items, dates
- Products: Inventory, pricing, variants
- Users: Registration dates, order history
- Payments: Payment status and amounts
- Returns: Refund amounts
- Shipping Methods: Provider usage and costs
Performance Considerations
- Analytics queries can be resource-intensive for large datasets
- Use appropriate timeframes to limit data volume
- Consider caching analytics results for frequently accessed data
- Longer timeframes (90d) may require additional processing time