Spend Trends
Navigate to Analytics → Spend → Spending Trends in the sidebar, or open /analytics/spend-trends.

Summary
Section titled “Summary”Report Spend Trends report displays an analysis of WhatsApp (and other channel) conversation costs over the selected period. The report consists of two KPI cards, a daily cost bar chart, and a pie chart of cost distribution by conversation category.
API Used
Section titled “API Used”Date parameters are taken from global date range at the top of the Analytics page. Format: yyyy-MM-dd.
KPI Cards
Section titled “KPI Cards”Total Estimated Cost
Section titled “Total Estimated Cost”Displays the total conversation cost during the selected period, along with the percentage change compared to the previous period.
| Aspect | Details |
|---|---|
| Data source | data.kpis.totalCost — array CurrencyKpiMetric, one entry per active currency |
| Value | Divided by 100,000 then formatted as currency (e.g. Rp 1,250,000 for IDR) |
| Perubahan | change * 100, displayed with 1 decimal (e.g. “+12.3%“) |
| Indicator color | Up (positive) = red/destructive (rising costs are considered bad); Down (negative) = green/success (falling costs are considered good) |
| Label | ”vs. previous period” |
Avg. Cost per Conversation
Section titled “Avg. Cost per Conversation”Displays the average cost for each conversation that occurred during the selected period.
| Aspect | Details |
|---|---|
| Data source | data.kpis.avgCostPerConversation — array CurrencyKpiMetric |
| Value | Divided by 100,000 then formatted as currency |
| Perubahan | Same as Total Cost — indicator color and direction are identical |
Multi-Currency
Section titled “Multi-Currency”KPI cards display all active currencies simultaneously (for example, IDR and USD in one card). Select a currency via the dropdown in the daily cost chart title.
Available currencies are fetched from data.kpis.totalCost.map(c => c.currency). Default: IDR. If a previously selected currency is no longer available after the data changes, it is automatically reset to the first currency in the list.
Bar Chart — Daily Cost
Section titled “Bar Chart — Daily Cost”| Aspect | Details |
|---|---|
| Type | Bar chart (Recharts BarChart) |
| Data source | data.dailyCostChart — array of daily { date, costs: { IDR, USD } } |
| X axis | Date, formatted as “Mon DD” (e.g. “Jun 1”) |
| Y axis | Cost in the selected currency, formatted with formatCurrency |
| Tooltip | Displays the cost value with full currency format |
| Bar color | hsl(221.2 83.2% 53.3%) (blue) |
Pie Chart — Cost per Conversation Category
Section titled “Pie Chart — Cost per Conversation Category”| Aspect | Details |
|---|---|
| Type | Donut chart (Recharts PieChart with innerRadius: 50) |
| Data source | data.costByCategory — array { type, costs: { IDR, USD } } |
| Filter | Only categories with cost > 0 are displayed |
| Legend | Vertical, to the right of the chart |
Conversation Categories
Section titled “Conversation Categories”| Category | Color | Description |
|---|---|---|
| Marketing | Green (hsl(142.1 76.2% 36.3%)) | Promotional and marketing messages |
| Utility | Blue (hsl(221.2 83.2% 53.3%)) | Transactional messages and notifications |
| Authentication | Purple (hsl(262.1 83.3% 57.8%)) | OTP messages and identity verification |
| Service | Pink (hsl(346.8 77.2% 49.8%)) | Customer service messages |
| Unknown | Gray (hsl(215 20.2% 65.1%)) | Unrecognized category |
Financial Value Scale
Section titled “Financial Value Scale”All financial values from the API use an integer scale (multiplied by 100,000). The portal divides by 100,000 before displaying:
- IDR: no decimals (e.g., Rp 1.250.000)
- USD: 2 decimals (e.g. $8.50)
Error Status
Section titled “Error Status”| Condition | Display |
|---|---|
| Authentication token not found | Red alert: “Authentication token not found.” |
| API request failed | Red alert with an error message |
| No data | Text message: “No cost data available for the selected period.” |
| Loading | Text: “Loading cost analytics…” |
Important Note
Section titled “Important Note”- The date range is controlled by the global DateRangePicker in the Analytics page header (default: last 30 days).
- Cost changes (up/down indicators) are calculated by the backend — the portal does not calculate them itself.
- The change indicator color uses inverted logic: a cost increase is shown in red (bad), a cost decrease is shown in green (good).