Admin Analytics Reference
The Admin Portal provides comprehensive analytics for monitoring platform activity, money flow, and event health. This guide explains what each metric means and where the data comes from.
Metric Definitions
Money Flow Metrics
| Metric | Description | Data Source |
|---|---|---|
| USDC In | New USDC coming into the platform from purchases (points_purchase, stripe_mint, stripe_purchase). This is money flowing INTO the platform. | transaction_events where event_type IN ('points_purchase', 'stripe_mint', 'stripe_purchase', 'purchase') |
| LTZ Spent | LTZ tokens spent/burned on perk claims and redemptions. This is LTZ flowing OUT of user wallets. | transaction_events where event_type IN ('perk_claim', 'redemption', 'claim', 'burn') |
| Total Transactions | Total number of transaction events recorded across all types. | Count of all transaction_events |
| Unique Customers | Number of unique wallet addresses that have made at least one transaction. | Distinct customer_address from transaction_events |
Event Health Metrics
| Metric | Description | Data Source |
|---|---|---|
| Total Events | Total events processed by a source | Count from respective event tables |
| Success Rate | Percentage of events that completed successfully | reward_status = 'success' or processing_status = 'processed' |
| Failed Events | Events that failed to process | reward_status != 'success' or processing_status != 'processed' |
Data Sources
Primary Tables
| Table | Purpose | Key Columns |
|---|---|---|
transaction_events | Records all on-chain transactions (purchases, claims) | event_type, amount_ltz, amount_usdc, partner_address, customer_address, timestamp |
daily_analytics | Pre-aggregated daily stats per partner (may be stale) | date, partner_address, total_ltz_points, total_usdc_invested |
discord_gateway_events | Discord bot gateway events (GM/GN, voice, messages) | event_type, reward_amount, reward_status, brand_id, server_id |
discord_third_party_events | Third-party bot events (Mee6, Arcane level-ups) | source_bot, event_type, reward_amount, reward_status |
website_monitoring_events | Web SDK events (account_creation, form_submit) | event_type, brand_id, processing_status |
reward_distributions | LTZ rewards minted from events | brand_id, amount, processing_status, created_at |
analytics_events | Perk market activity (views, claims, searches) | event_type, collection_id, partner_id |
Source of Truth
For money flow metrics, always use transaction_events rather than daily_analytics. The daily_analytics table may contain stale or conflated data from various sources. The transaction_events table records actual on-chain transactions with clear event_type classification.
Event Sources and Coverage
Event Coverage Matrix
| Event Source | Handler | Tables Written | Admin Visibility |
|---|---|---|---|
| Web SDK | cloudflare-automation/event-handler | website_monitoring_events, reward_distributions, transaction_events | Analytics → Event Health, Channel Mix |
| Stripe Purchases | cloudflare-automation/stripe-mint | transaction_events | Analytics → USDC In, Daily Money Flow |
| Perk Claims | cloudflare-automation/consume-perk | transaction_events, perk_redemptions | Analytics → LTZ Spent, Daily Money Flow |
| POS Redemptions | cloudflare-automation/pos-redemption | transaction_events | Analytics → LTZ Spent |
| Discord Gateway | loyalteez-discord-bot/gateway-event-handler | discord_gateway_events | Discord Tab, Analytics → Channel Mix |
| Discord Third-Party | loyalteez-discord-bot/gateway-event-handler | discord_third_party_events | Discord Tab, Analytics → Channel Mix |
| Discord Perk Claims | loyalteez-discord-bot/perk-claim-handler | transaction_events | Analytics → LTZ Spent |
| Perk Market | Various frontend + backend | analytics_events | Analytics → Top Perks, Conversion Rates |
Event Types by Category
USDC Inflow Events
These events represent money coming into the platform:
points_purchase- Direct LTZ purchase via Stripestripe_mint- Stripe webhook completed purchasestripe_purchase- Stripe checkout completedpurchase- Generic purchase event
LTZ Outflow Events
These events represent LTZ being spent/burned:
perk_claim- User claims a perkredemption- POS redemptionclaim- Generic claim eventburn- Direct LTZ burn
Discord Events
gm/gn- Good morning/night messagesvoice_activity- Voice channel participationmessage_activity- Text channel participationreaction_add- Reaction addedlevel_up- Third-party bot level-up (Mee6, Arcane)streak_milestone- Streak achievement
Web SDK Events
account_creation- New account registeredemail_verification- Email verifiednewsletter_signup- Newsletter subscriptionform_submit- Form submissionpage_view- Page visited (if tracked)- Custom events based on brand configuration
Admin Portal Views
Overview Tab
- Stats Cards: Total transactions, USDC In, LTZ Spent, Unique customers
- USDC In vs LTZ Spent Chart: Dual-line chart comparing money flow over time
- Events by Source Chart: Bar chart showing event volume by channel
- Channel Mix Table: Source, Events, LTZ, USDC, Success Rate
- Event Health Table: Source, Total, Success, Failed, Success Rate
- Events by Type Table: Event type, Source, Count, LTZ
- Daily Money Flow Table: Date, USDC In, LTZ Spent, Events, Unique Customers (with drill-down)
Revenue Tab
- Revenue trends over time
- Revenue by partner
- Revenue by category
Partners Tab
- Partner performance rankings
- LTZ and USDC volume by partner
- Transaction counts and customer counts
Discord Tab
- Gateway events
- Third-party events
- User stats
Drill-Down Capability
The Daily Money Flow table supports drill-down by clicking on any date row. This reveals:
- Breakdown by Brand: Which partners contributed to that day's activity
- Event Type Mix: What types of events occurred
- LTZ and USDC: Amount per brand/event type
Excluding Incomplete Data
Unnamed Partners
Partners who haven't completed onboarding (profile setup) are identified by their business_name matching one of:
- "Smart Account Partner"
- "Business Account"
- "Business Partner"
- "Unnamed Business"
- "Unnamed Partner"
- Empty/null
These are excluded from:
- Partner stats (Total Partners, Basic/Premium/Enterprise counts)
- Partner performance rankings (with toggle to show them)
Failed Events
Gateway events that failed processing are not written to discord_gateway_events to avoid polluting analytics with unconfigured/failed events.
Related Documentation
- Event Handler API - API for submitting events
- Database Schema - Discord tables
- Partner Portal Guide - Managing events