Skip to main content

Analytics Module

Gain insights with customizable dashboards, cross-module metrics, customer profiles, and automated reporting.

Base URL: https://app.proign.com/[tenant]/analytics/api

Overview

The Analytics module aggregates data from every enabled module into a unified business intelligence layer:

  • Customizable dashboards with drag-and-drop widgets
  • Cross-module metrics with real-time and historical views
  • Scheduled and on-demand report generation
  • Customer profiles with lifetime value and segmentation
  • Export to CSV, PDF, and JSON formats
  • Role-based dashboard sharing (admin, operator, dealer)

Key Features

Dashboards

Build custom dashboards using a library of widget types:

WidgetDescriptionBest For
Line ChartTime-series data over a rangeRevenue trends, order volume
Bar ChartCategorical comparisonsProduct performance, regional sales
Pie / DonutProportional breakdownOrder status distribution
Area ChartStacked time-seriesModule activity overlap
KPI CardSingle metric with trend indicatorTotal revenue, open tickets
Data TableTabular data with sorting and filtersTop products, customer lists
Geo MapGeographic heat mapShipment destinations, customer locations

Dashboards support layout customization with resizable widget grids. Each dashboard can be shared with specific roles or kept private.

Cross-Module Metrics

Track KPIs across every PROIGN module from a single view:

ModuleExample Metrics
FulfillmentOrders processed, avg delivery time, shipment volume
RewardsPoints earned, redemptions, active dealers
CampaignEmail opens, click rate, conversions, unsubscribes
SupportOpen tickets, avg resolution time, CSAT score
MESOEE, machine uptime, alarm frequency
CatalogProducts published, catalogs generated, Shopify sync status
InventoryStock levels, low-stock alerts, receiving volume

Scheduled Reports

Automate report generation and delivery:

  • Frequency — Daily, weekly, monthly, or custom cron
  • Scope — Single module, combined, or tenant-wide
  • Format — CSV for data analysis, PDF for stakeholders, JSON for integrations
  • Delivery — Email via Resend, or download from dashboard
  • Filters — Date range, module, dimension, customer segment

Customer Profiles

Unified customer view that aggregates activity across all modules:

  • Lifetime Value (LTV) — Total revenue attributed to a customer across orders, subscriptions, and purchases
  • Engagement Score — Weighted score based on recency, frequency, and breadth of module interactions
  • Segments — Auto-assign customers to segments (high-value, at-risk, new, dormant) based on configurable rules
  • Activity Timeline — Chronological feed of all customer touchpoints: orders, support tickets, warranty registrations, campaign interactions

Data Retention & Aggregation

Analytics data follows a tiered retention policy to balance granularity with storage:

Data TypeGranularityRetention
Raw metric eventsPer-event90 days
Hourly rollups1-hour buckets6 months
Daily rollups1-day buckets2 years
Customer profilesAggregatedIndefinite
Generated reportsSnapshot1 year

API Endpoints

Dashboards

GET    /api/[tenant]/dashboards             # List all dashboards
POST   /api/[tenant]/dashboards             # Create dashboard (admin)
GET    /api/[tenant]/dashboards/[id]        # Get dashboard with widgets
PATCH  /api/[tenant]/dashboards/[id]        # Update dashboard layout
DELETE /api/[tenant]/dashboards/[id]        # Delete dashboard (admin)

Widgets

POST   /api/[tenant]/dashboards/[id]/widgets  # Add widget to dashboard
PATCH  /api/[tenant]/widgets/[id]             # Update widget config
DELETE /api/[tenant]/widgets/[id]             # Remove widget

Metrics

GET    /api/[tenant]/metrics                # Query metrics with filters
POST   /api/[tenant]/metrics                # Record a metric event
GET    /api/[tenant]/metrics/summary        # Aggregated metric summary

Reports

GET    /api/[tenant]/reports                # List reports
POST   /api/[tenant]/reports                # Create/generate report
GET    /api/[tenant]/reports/[id]           # Get report details
GET    /api/[tenant]/reports/[id]/download  # Download report file

Customers

GET    /api/[tenant]/customers              # List customer profiles
GET    /api/[tenant]/customers/[id]         # Get customer detail
POST   /api/[tenant]/customers              # Upsert customer profile
GET    /api/[tenant]/customers/[id]/timeline # Activity timeline

Segments

GET    /api/[tenant]/segments               # List segments
POST   /api/[tenant]/segments               # Create segment with rules
GET    /api/[tenant]/segments/[id]/members  # Get segment members

Request Examples

Record Metric

POST /api/[tenant]/metrics
Content-Type: application/json

{
  "name": "order_value",
  "value": 249.99,
  "module": "fulfillment",
  "dimensions": {
    "region": "us-west",
    "product_category": "accessories"
  }
}

Query Metrics with Grouping

GET /api/[tenant]/metrics?name=order_value&from=2026-01-01&to=2026-01-31&group_by=day

// Response
{
  "data": [
    { "date": "2026-01-01", "value": 12450.00, "count": 48 },
    { "date": "2026-01-02", "value": 8920.50, "count": 35 },
    { "date": "2026-01-03", "value": 15230.00, "count": 61 }
  ],
  "summary": {
    "total": 285600.50,
    "count": 1124,
    "average": 254.09
  }
}

Create Dashboard

POST /api/[tenant]/dashboards
Content-Type: application/json

{
  "name": "Operations Overview",
  "description": "Daily operations KPIs",
  "shared_with": ["admin", "operator"],
  "widgets": [
    {
      "type": "kpi_card",
      "title": "Orders Today",
      "metric": "order_count",
      "module": "fulfillment",
      "period": "today",
      "position": { "x": 0, "y": 0, "w": 3, "h": 2 }
    },
    {
      "type": "line_chart",
      "title": "Weekly Revenue",
      "metric": "order_value",
      "module": "fulfillment",
      "period": "7d",
      "group_by": "day",
      "position": { "x": 3, "y": 0, "w": 9, "h": 4 }
    }
  ]
}

Schedule Report

POST /api/[tenant]/reports
Content-Type: application/json

{
  "name": "Weekly Fulfillment Summary",
  "modules": ["fulfillment", "inventory"],
  "format": "pdf",
  "schedule": {
    "frequency": "weekly",
    "day": "monday",
    "time": "08:00"
  },
  "delivery": {
    "email": ["ops@company.com", "manager@company.com"]
  },
  "filters": {
    "date_range": "last_7_days"
  }
}

Related