Version: 2.0 | Status: Final Draft | Last Updated: 2026-01-15
Change Log
| Version | Date | Changes |
|---|
| 1.0 | Initial | Technical draft with implementation details |
| 2.0 | 2026-01-15 | Converted to business-focused format; added success metrics; consolidated requirements; strengthened acceptance criteria |
1. Overview
1.1 Purpose
The Analytics & Reporting system provides business intelligence and operational visibility across the Toprent.app platform through two distinct capabilities:
-
Tenant Analytics Dashboard: Enables rental companies to analyze their order data, revenue, and operational metrics through an in-app dashboard with CSV export for external analysis.
-
Platform Intelligence (Internal): Collects anonymized feature usage data across all tenants to inform product decisions, track adoption patterns, and identify optimization opportunities.
1.2 Business Value
For Rental Companies (Tenant-Facing)
| Value Claim | Measurable Outcome | Measurement Method |
|---|
| Revenue visibility | 100% of financial data accessible in single view | Dashboard completeness audit |
| Faster reporting | Reduce report generation time by 75% (from 2+ hours to <30 min) | Time-study comparison vs. manual Excel work |
| Data-driven decisions | Enable weekly performance reviews (vs. monthly/quarterly) | Tenant engagement analytics |
| Value Claim | Measurable Outcome | Measurement Method |
|---|
| Product intelligence | Track 100% of key feature interactions | Event coverage audit in Mixpanel |
| Data-driven roadmap | Base 80% of feature prioritization on usage data | PM decision documentation review |
| Adoption insights | Identify underutilized features (<20% adoption) for improvement | Monthly feature adoption report |
| Performance visibility | Detect error patterns within 24 hours | Sentry + Mixpanel correlation analysis |
1.3 Target Users
| User Role | Primary Goals | Access Level |
|---|
| Company Admin | Analyze business performance, generate reports, export data | Own company data only |
| Product Manager | Understand feature adoption, prioritize roadmap | Anonymized cross-tenant data |
| Engineering Team | Monitor system health, identify technical issues | Anonymized performance data |
| Data Analyst | Generate platform-wide insights | Anonymized aggregate data |
1.4 Scope
In Scope:
- In-app analytics dashboard with date filtering and CSV export (tenant-facing)
- Real-time event tracking infrastructure for feature usage
- Privacy-preserving analytics with hashed identifiers
- Batch export APIs for historical data backfill
Out of Scope:
- Tenant access to platform-wide analytics
- Visual charts or real-time dashboards in tenant UI (CSV export only)
- Predictive analytics or automated insights
- Custom report builders
2. Success Metrics
2.1 Tenant Analytics Dashboard
| Metric | Definition | Baseline | Target | Measurement Method | Timeframe |
|---|
| Dashboard Adoption | % of active tenants using analytics monthly | 0% (new feature) | 40% | Analytics usage events | 6 months |
| Export Frequency | Average exports per tenant per month | 0 | 2+ | Export event tracking | 3 months |
| Report Time Savings | Time to generate monthly report | 2+ hours (manual) | <30 min | User survey + time study | 3 months |
| Query Performance | Average analytics query response time | N/A | <15 seconds | System monitoring | Ongoing |
| Metric | Definition | Baseline | Target | Measurement Method | Timeframe |
|---|
| Event Coverage | % of key features tracked | 0% | 100% | Event audit vs. feature list | 3 months |
| Data Quality | Events with complete required properties | N/A | 99%+ | Mixpanel data validation | Ongoing |
| Tracking Latency | Time from action to Mixpanel receipt | N/A | <5 seconds | Event timestamp analysis | Ongoing |
| Error Rate | % of failed analytics events | N/A | <0.1% | Sentry error monitoring | Ongoing |
| Privacy Compliance | Events containing PII | N/A | 0 | Automated PII scanning | Ongoing |
2.3 Business Impact
| Metric | Definition | Baseline | Target | Measurement Method | Timeframe |
|---|
| Data-Driven Decisions | Roadmap decisions backed by usage data | ~20% | 80% | PM decision log review | 6 months |
| Feature Discovery | Underutilized features identified | 0 | 5+ per quarter | Adoption analysis | Quarterly |
| Time to Insight | Days to answer product questions | 3-5 days | <1 day | PM request tracking | 3 months |
3. User Stories
3.1 Tenant Admin Users
| ID | Priority | User Story | Acceptance Criteria |
|---|
| US-TA1 | P0 | As a company admin, I want to view my company’s order analytics for a date range so I can analyze business performance | Given admin accesses Analytics, When they select dates ≤180 days, Then order data displays within 30 seconds |
| US-TA2 | P0 | As a company admin, I want to export analytics as CSV so I can perform detailed analysis in spreadsheets | Given analytics data is loaded, When admin clicks export, Then CSV downloads with all displayed data |
| US-TA3 | P1 | As a company admin, I want complete financial visibility (revenue, profit, expenses, payments) so I can track profitability | Given analytics displays, Then all financial fields are included and correctly calculated |
| US-TA4 | P2 | As a company admin, I want to see performance by customer, vehicle, and operator so I can identify top performers | Given analytics displays, Then dimension breakdowns are available in export |
3.2 Internal Product Team
| ID | Priority | User Story | Acceptance Criteria |
|---|
| US-PT1 | P0 | As a product manager, I want to see reservation creation volume so I can track core product usage | Given reservations are created, Then events appear in Mixpanel within 5 seconds |
| US-PT2 | P0 | As a product manager, I want to track feature adoption rates so I can prioritize improvements | Given features are used, Then usage data is available for analysis |
| US-PT3 | P1 | As a product manager, I want to identify payment method preferences so I can prioritize integrations | Given payments are processed, Then payment type distribution is visible |
| US-PT4 | P1 | As an engineering lead, I want to track failure events so I can identify and fix systemic issues | Given errors occur, Then failure events are captured with relevant context |
| ID | Priority | User Story | Acceptance Criteria |
|---|
| US-PO1 | P0 | As a platform admin, I want analytics events captured automatically so usage patterns are tracked without manual intervention | Given key actions occur, Then events emit automatically |
| US-PO2 | P0 | As a security engineer, I want tenant identifiers anonymized so data privacy is maintained | Given events are sent, Then all IDs are hashed/encrypted, zero PII present |
| US-PO3 | P1 | As a developer, I want export APIs for bulk data so I can backfill historical analytics | Given export API is called, Then historical data uploads to Mixpanel |
4. Functional Requirements
4.1 Tenant Analytics Dashboard
| ID | Requirement | Business Rationale |
|---|
| FR-4.1.1 | Dashboard must be accessible from Settings > Analytics for admin users | Centralized access point for business intelligence |
| FR-4.1.2 | Date range selection with maximum 180-day span | Balances data access with system performance |
| FR-4.1.3 | Analytics must include: order details, customer info, vehicle info, financial data, payment data, operator/courier assignments | Complete operational visibility in single view |
| FR-4.1.4 | System must calculate derived metrics: total days, total income, extra charges, due balance | Automated calculations reduce manual effort |
| FR-4.1.5 | CSV export with localized headers and filename including date range | Enables external analysis and record-keeping |
| FR-4.1.6 | Clear loading states and empty state messaging | Professional user experience |
| ID | Requirement | Business Rationale |
|---|
| FR-4.2.1 | Track reservation events (created, failed) with pricing and location data | Core product usage visibility |
| FR-4.2.2 | Track payment events (invoices, payments) with amount and method | Revenue stream analysis |
| FR-4.2.3 | Track vehicle events (created, updated) with classification data | Fleet management adoption |
| FR-4.2.4 | Track feature-specific events (AI scanning, signature requests, exports, autofill) | Feature adoption measurement |
| FR-4.2.5 | Support both server-side and client-side event emission | Complete interaction coverage |
| FR-4.2.6 | All events must include hashed tenant ID and anonymized user ID | Cross-tenant analysis with privacy |
4.3 Privacy and Security
| ID | Requirement | Business Rationale |
|---|
| FR-4.3.1 | Encrypt/hash all tenant and user identifiers before analytics transmission | Maintain data privacy compliance |
| FR-4.3.2 | Never include PII in analytics: no names, emails, phones, detailed addresses | Regulatory compliance (GDPR) |
| FR-4.3.3 | Standardize location data to country/city level only | Balance geographic insights with privacy |
| FR-4.3.4 | Analytics failures must not impact business operations | System reliability priority |
| FR-4.3.5 | All tracking must be asynchronous and non-blocking | User experience priority |
4.4 Export APIs (Historical Backfill)
| ID | Requirement | Business Rationale |
|---|
| FR-4.4.1 | Authenticated export endpoints for orders, vehicles, users, payments, invoices | Complete historical data migration |
| FR-4.4.2 | Batch processing with configurable batch size | Handle large datasets without timeout |
| FR-4.4.3 | Filter to active companies (recent login) by default | Optimize processing resources |
| FR-4.4.4 | Apply same privacy controls as real-time events | Consistent data protection |
5. Acceptance Criteria
5.1 Tenant Dashboard
| ID | Criteria | Test Method |
|---|
| AC-TD1 | Admin can select date range ≤180 days and receive analytics within 30 seconds | Performance test with maximum date range |
| AC-TD2 | Analytics includes all financial, operational, and entity data | Data completeness audit |
| AC-TD3 | System displays clear error when date range exceeds limit | Validation testing |
| AC-TD4 | CSV export includes all displayed data with correct calculations | Export comparison test |
| AC-TD5 | Derived metrics (income, balance, days) calculate correctly | Calculation verification |
| ID | Criteria | Test Method |
|---|
| AC-PA1 | Server-side events emit within 5 seconds of action | Event latency monitoring |
| AC-PA2 | Client-side events emit on user interaction | Integration testing |
| AC-PA3 | All events contain hashed accountId and distinctId | Event property audit |
| AC-PA4 | Zero PII present in any analytics event | PII scanning automation |
| AC-PA5 | Analytics tracking does not impact page load or action performance | Performance benchmarking |
| AC-PA6 | Analytics errors logged to monitoring without breaking features | Failure injection testing |
| AC-PA7 | Analytics data not exposed to tenants via any interface | Security audit |
5.3 Export APIs
| ID | Criteria | Test Method |
|---|
| AC-EA1 | Exports require authentication | Security testing |
| AC-EA2 | Batch processing handles 100+ companies without timeout | Load testing |
| AC-EA3 | Exported events include timestamps for historical accuracy | Data validation |
| AC-EA4 | Privacy controls applied consistently with real-time events | Privacy audit |
6. Business Rules
6.1 Tenant Dashboard Rules
| ID | Rule | Rationale |
|---|
| BR-6.1.1 | Maximum date range: 180 days | Prevent database overload and ensure query performance |
| BR-6.1.2 | Total days calculated per tariff variant and buffer settings | Accurate billing-aligned reporting |
| BR-6.1.3 | Income = sum of payments; Balance = total price - payments | Standard financial calculations |
| BR-6.1.4 | Owner displayed as “Own” or partner company name | Clear ownership visibility |
6.2 Privacy Rules
| ID | Rule | Rationale |
|---|
| BR-6.2.1 | Tenant IDs must be encrypted before analytics transmission | Anonymize tenant identity |
| BR-6.2.2 | User IDs converted to global format for anonymization | Protect user privacy |
| BR-6.2.3 | No PII in any analytics event | GDPR compliance |
| BR-6.2.4 | Location data limited to city/country | Balance insights with privacy |
| BR-6.2.5 | Analytics failures must fail silently | Business continuity priority |
6.3 Export Rules
| ID | Rule | Rationale |
|---|
| BR-6.3.1 | Export APIs internal-only with authentication | Security requirement |
| BR-6.3.2 | Process only active companies by default | Resource optimization |
| BR-6.3.3 | Default batch size: 10 companies | Prevent timeout issues |
| BR-6.3.4 | Individual record failures must not fail entire batch | Maximize data export success |
7. Dependencies
7.1 Depends On
| PRD | Dependency Type | Specific Requirements |
|---|
| PRD-01 Multi-tenant | Data | Scoped database access, company isolation |
| PRD-02 Authentication | Security | Admin role verification, user context |
| PRD-03 Vehicle Management | Data | Vehicle attributes for analytics |
| PRD-04 Client Management | Data | Customer data for reporting |
| PRD-05 Partner Management | Data | Partner relationships |
| PRD-06 Order System | Data | Order data (core analytics source) |
| PRD-07 Pricing Engine | Logic | Tariffication for day calculations |
| PRD-08 Insurance/Extras | Data | Expense data |
| PRD-09 Payments | Data | Payment events and data |
| PRD-10 Communications | Events | Email dispatch tracking |
| PRD-11 Document Management | Events | Signature request tracking |
| PRD-12 Fleet Operations | Events | Reminder and courier tracking |
7.2 Depended By
None. Analytics is a consuming domain that does not block other features.
8. Non-Functional Requirements
| Category | Requirement | Target | Measurement |
|---|
| Performance | Dashboard query response | <30 seconds for 180-day range | System monitoring |
| Performance | Event tracking overhead | <10ms per event | Performance profiling |
| Scalability | Event throughput | 1000+ events/minute | Load testing |
| Privacy | PII in events | Zero | Automated scanning |
| Reliability | Analytics availability | Does not impact business operations | Failure injection tests |
| Compliance | GDPR adherence | Full compliance via anonymization | Compliance audit |
| Security | Export API access | Internal-only with authentication | Security audit |
9. Glossary
| Term | Definition |
|---|
| Platform Analytics | Internal analytics tracking feature usage across all tenants (not accessible to tenants) |
| Tenant Dashboard | In-app analytics UI where admins view and export their own company’s data |
| Analytics Event | Tracked occurrence of business or user action sent to analytics platform |
| DistinctId | Anonymized user identifier for tracking |
| AccountId | Encrypted tenant identifier for cross-tenant analysis |
| PII | Personally Identifiable Information - never included in analytics |
| Export API | Internal batch endpoints for historical data migration |
| Active Company | Tenant with login activity within last 3 months |
10. Open Questions
- Tenant dashboard - any plans for visual charts/graphs vs. CSV-only?
- Export APIs - retention policy for backfilled historical data?
- Feature tracking - complete event list confirmed?
- Active company threshold - 3 months appropriate?