Spend & Financial Dashboard
Relevant source files
The following files were used as context for generating this wiki page:
The Spend & Financial Dashboard is a comprehensive accounting and performance tracking module within the FusionOps platform. Its primary purpose is to provide "Full Accounting," calculating the "True Cost" of marketing operations by aggregating raw ad spend with associated financial overheads, such as VAT and payment card fees, and reconciling these against revenue and conversion data.
The system integrates with external financial services (LendingCard) and traffic tracking platforms (Voluum) to provide a unified view of Return on Investment (ROI). It allows operators to monitor financial health across multiple dimensions, including per-account, per-card, and per-domain performance, facilitating data-driven decisions for campaign scaling and budget management.
Architecture and Data Integration
The dashboard architecture relies on a central React component that orchestrates data fetching from various services and environment configurations. It utilizes a tabbed interface to separate different financial views.
Data Flow Overview
The system aggregates data from three primary sources:
- Neon Postgres/Local Settings: Stores API tokens and user preferences (e.g., hiding revenue).
- LendingCard API: Provides transaction-level data for card spend and fees.
- Voluum API: Provides traffic metrics, raw ad cost, and revenue data.
The following diagram illustrates the data aggregation and reconciliation process:
Financial Calculations
The system computes the "True Cost" by applying specific multipliers to the raw ad spend reported by the tracker.
- VAT: Calculated at 7% of raw spend.
- LendingCard Fees: Calculated at 3.5% of raw spend.
- True Cost (TC):
Spend + VAT + LendingCard Fees. - ROI:
((Revenue - True Cost) / True Cost) * 100.
Sources: src/components/SpendDashboard.jsx:96-102, components/SpendDashboard.jsx:54-60
Key Features and Components
The dashboard is organized into specialized tabs, each focusing on a specific aspect of the operation's finances.
| Tab Value | Label | Description |
|---|---|---|
overview | Overview | High-level summary of spend, conversions, revenue, and ROI trend charts. |
daily | Daily Log | Tabular view of daily performance metrics including clicks, visits, and profit. |
account | Per Account | Breakdown of financial performance by individual advertising accounts. |
card | Per Card | Tracking spend and transactions associated with specific LendingCard virtual cards. |
pnl | P&L | Monthly Profit and Loss statement aggregating all costs and revenue. |
opex | Opex | Management of operational expenses beyond direct ad spend. |
Sources: src/components/SpendDashboard.jsx:17-27, components/SpendDashboard.jsx:17-26
Date Range Management
The dashboard supports several presets for data visualization, allowing for both short-term performance checks and month-to-date accounting.
Configuration and Security
The dashboard requires specific API credentials to be configured within the Settings module to function correctly.
Required Settings
| Setting Key | Source | Purpose |
|---|---|---|
lcToken | VITE_LENDINGCARD_TOKEN | Authentication for LendingCard transaction data. |
voluumAccessKeyId | VITE_VOLUUM_ACCESS_KEY_ID | Access ID for Voluum tracker sessions. |
voluumAccessKey | VITE_VOLUUM_ACCESS_KEY | Access Secret for Voluum tracker sessions. |
apiSecret | Settings UI | Used for Bearer token authentication in Tracking Reconcile calls. |
Sources: components/Settings.jsx:17-30, src/components/SpendDashboard.jsx:188-189
Privacy Controls
The hideRevenue setting allows operators to obfuscate sensitive financial data in the UI while still monitoring relative performance or spend. This is passed as a prop to child tabs to conditionally render revenue and profit figures.
Sources: src/components/SpendDashboard.jsx:50, src/components/spend/OverviewTab.jsx:5
Integration with Tracking Systems
The dashboard features a TrackingReconcileTab which interacts with the project's primary API.
Summary
The Spend & Financial Dashboard acts as the central hub for financial oversight in FusionOps. By automating the extraction and normalization of data from LendingCard and Voluum, it provides a "True Cost" analysis that accounts for the hidden overheads of affiliate marketing. Its modular tabbed structure ensures that developers and operators can drill down from high-level ROI trends to granular per-card or per-account transaction logs, while maintaining security through Bearer token validation and configurable privacy settings.