System Overview
The Marketing Portal enables advertisers to create and manage ad campaigns that display to free-tier users in the MiFamilias mobile app.
Campaign Approval Workflow
All ad campaigns go through a review process before going live. This ensures ad quality and policy compliance.
Status Definitions
| Status | Description | Actions Available |
|---|---|---|
| Draft | Campaign created but not submitted | Edit, Submit for Review, Delete |
| Pending Review | Awaiting admin approval (1-2 business days) | View only |
| Approved | Approved, waiting for start date | View, Edit budget |
| Rejected | Rejected with feedback | Edit & Resubmit |
| Active | Running and serving impressions | Pause, View Analytics |
| Paused | Temporarily stopped by advertiser | Resume, Edit |
| Completed | End date reached or budget exhausted | View Analytics, Duplicate |
Ad Serving Flow
How ads are served to users in the mobile app based on subscription tier.
Analytics & Metrics
Key performance indicators tracked for each campaign.
(Clicks/Impressions)"] CPC["CPC
(Spend/Clicks)"] CPM["CPM
(Spend/1000 Impr)"] end subgraph Breakdowns["Breakdowns"] ByCamp["By Campaign"] ByDay["By Day of Week"] ByHour["By Hour"] ByPlatform["By Platform"] ByAge["By Age Group"] end IMP --> CTR CLK --> CTR CLK --> CPC IMP --> CPM CTR --> ByCamp CTR --> ByDay CTR --> ByHour CTR --> ByPlatform CTR --> ByAge
Metric Definitions
| Metric | Formula | Description |
|---|---|---|
| Impressions | Count | Number of times ad was viewed |
| Clicks | Count | Number of times ad was clicked |
| CTR (Click-Through Rate) | (Clicks / Impressions) × 100 | Percentage of impressions that resulted in clicks |
| CPC (Cost Per Click) | Spend / Clicks | Average cost for each click |
| CPM (Cost Per Mille) | (Spend / Impressions) × 1000 | Cost per 1,000 impressions |
Portal Structure
Pages available in the Marketing Portal (marketing.mifamilias.com).
Overview & Quick Stats"] Camp["/campaigns.html
Campaign Management"] Anal["/analytics.html
Detailed Metrics"] Bill["/billing.html
Credits & Payments"] end Index -->|Login| Dash Dash --> Camp Dash --> Anal Dash --> Bill Camp --> Anal Bill --> Anal
Page Features
| Page | Features |
|---|---|
| index.html |
|
| dashboard.html |
|
| campaigns.html |
|
| analytics.html |
|
| billing.html |
|
Admin Review Process
How administrators review and approve/reject submitted campaigns.
Review Checklist
- ✓ Image is appropriate (no offensive content)
- ✓ Text is accurate and not misleading
- ✓ Destination URL is valid and safe
- ✓ Category is correct
- ✓ Complies with advertising policies
Billing & Credits System
Prepaid credit system for advertising spend with Stripe integration.
Credit Packs
| Pack | Amount | Credits | Bonus | Effective Rate |
|---|---|---|---|---|
| Starter | $100 | 10,000 | 0% | $10 / 1,000 credits |
| Growth | $500 | 52,500 | +5% | $9.52 / 1,000 credits |
| Scale | $1,000 | 110,000 | +10% | $9.09 / 1,000 credits |
| Enterprise | $2,500 | 287,500 | +15% | $8.70 / 1,000 credits |
Billing API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /advertisers/register |
Create advertiser account |
| POST | /advertisers/login |
Authenticate (returns JWT) |
| GET | /advertisers/profile |
Get advertiser profile |
| GET | /advertisers/billing |
Get billing overview (balance, methods, invoices) |
| POST | /advertisers/billing/payment-methods |
Add payment method (Stripe PaymentMethod) |
| DELETE | /advertisers/billing/payment-methods/{id} |
Remove payment method |
| PUT | /advertisers/billing/payment-methods/{id}/default |
Set default payment method |
| POST | /advertisers/billing/credits |
Purchase credits (processes payment) |
| GET | /advertisers/billing/invoices |
List invoices (paginated) |
| GET | /advertisers/billing/invoices/{id} |
Get invoice details with line items |
| PUT | /advertisers/billing/alerts |
Update alert preferences |
Alert Configuration
| Alert Type | Default | Description |
|---|---|---|
| Budget 80% | Enabled | Alert when monthly spend reaches 80% of limit |
| Low Credit | Enabled ($50) | Alert when credit balance falls below threshold |
| Daily Limit | $1,000/day | Maximum daily spend (prevents budget overruns) |
| Monthly Limit | $10,000/mo | Maximum monthly spend |
Stripe Integration
The billing system supports both live Stripe and demo mode:
- Live Mode: Set
STRIPE_SECRET_KEYenvironment variable - Demo Mode: Works without Stripe keys for development/testing
In demo mode, payment methods use mock card details and purchases succeed immediately without actual charges.
Roadmap
Planned features for the Marketing Portal.
| Phase | Features | Status |
|---|---|---|
| Phase 1-2 | Portal foundation, approval workflow | Complete |
| Phase 3 | Campaign duplication, pause/resume, editing, tags, search | Complete |
| Phase 4 | A/B testing with auto-optimize, statistical significance | Complete |
| Phase 5 | Dayparting, audience targeting, geographic/age/platform filters | Complete |
| Phase 6 | Creative library, image upload | Future |
| Phase 7 | Conversion tracking, attribution models, cohort analysis, reports | Complete |
| Phase 8 | Stripe billing, invoices, credit packs (backend complete) | Complete |
| Phase 9 | In-app messaging, notifications | Future |
| Phase 10 | REST API, webhooks | Future |