Campaign Analytics
Navigate to Analytics → Spending → Campaign in the sidebar, or open /analytics/campaigns.

Summary
Section titled “Summary”Tab Campaign displays a table of all campaign runs that occurred within the selected date range. Each row represents a single campaign execution with status, delivery volume, efficiency metrics, and cost.
API Used
Section titled “API Used”Date parameters are taken from the global date range. The limit always set to 20.
Filter
Section titled “Filter”| Filter | Function |
|---|---|
| Date Range | Global filter at the top of the Analytics page — sends startDate and endDate to the API |
This tab has no additional filters besides the global date range. If no date range has been selected, an alert is displayed: “Please select a date range to view campaign deliveries.”
Table Columns
Section titled “Table Columns”| The column | Description | How It Is Calculated |
|---|---|---|
| Run Details | Campaign name and run ID | campaign_name as bold text; run_id as small monospace text below it, width-limited to 200px with truncate |
| Status | Campaign run status badge | Based on the field status — see the status table below |
| Timeline | Run start time | start_time is formatted with date-fns format PPp (e.g., “Jun 1, 2026, 10:30:00 AM”) |
| Volume | Number sent vs. total recipients | sent_count.toLocaleString() / total_recipients.toLocaleString() — e.g., “9,500 / 10,000” |
| Efficiency | Delivery rate and read rate | Calculated on the client side — see the “Efficiency Calculation” section |
| Cost | Total run cost | formatFinancialValue(total_cost, 'display', currency) — value divided by 100,000 then formatted as currency |
| Actions | Button to view the detailed report | ”View Report” button — leads to /campaigns/{campaign_id}/runs/{run_id} |
Efficiency Calculation
Section titled “Efficiency Calculation”Two efficiency metrics are computed on the client side (frontend), not backend:
| Metric | Formula | Edge Condition |
|---|---|---|
| Delivery Rate | (delivered_count / sent_count) * 100 | If sent_count == 0, the result is 0% |
| Read Rate | (read_count / sent_count) * 100 | If sent_count == 0, the result is 0% |
Status Badge
Section titled “Status Badge”| API Status | Badge Color | Label |
|---|---|---|
RUNNING | Biru (bg-blue-500/20 text-blue-500) | “Running” |
COMPLETED | Hijau (bg-green-500/20 text-green-500) | “Completed” |
FAILED | Red (variant destructive) | “Failed” |
| Other | Standard outline | Original value from the API |
Detail Navigation
Section titled “Detail Navigation”Clicking a table row (or the “View Report” button) navigates to the campaign run detail page:
/campaigns/{campaign_id}/runs/{run_id}The detail page shows individual messages per recipient along with the status, time, and cost per message.
Pagination
Section titled “Pagination”| Aspect | Details |
|---|---|
| Page size | 20 runs per page |
| Controls | ”Previous” and “Next” buttons |
| Indicator | ”Page X of Y” format |
| Visibility | Pagination controls only appear if totalPages > 1 |
Empty State
Section titled “Empty State”When there are no campaign runs in the selected period:
- The table displays a single row with the text: “No campaign deliveries found in this period.”
- The column spans all 7 columns (colspan = 7).
Error Status
Section titled “Error Status”| Condition | Display |
|---|---|
| No date range selected | Yellow alert with a triangle icon: “Please select a date range to view campaign deliveries.” |
| Token not found / API failure | Red alert with an error message |
| Loading data | Animated spinner (Loader2) in the center of the content area |
Financial Value Scale
Section titled “Financial Value Scale”Field total_cost from the API uses integer scale (multiplied by 100,000). The portal calls formatFinancialValue(total_cost, 'display', currency) which divides by 100,000 and then formats as currency:
- IDR: no decimals (e.g., Rp 500,000)
- USD: 2 decimals (e.g., $3.50)
Important Note
Section titled “Important Note”- Efficiency metrics (delivery rate and read rate) are calculated on the frontend using the ratio
delivered_count/read_countagainstsent_count. - Entire table rows are clickable to navigate to the run detail (not just the “View Report” button).
- There is no direct export option in this tab — use Export Data to export campaign data.