GuidesAdminLoyalty Insights

Loyalty Insights

Admin analytics for the loyalty program, including tier distribution and star activity.

Tier Distribution

From analytics_loyalty_tiers view:

struct LoyaltyTierStats: Codable, Identifiable {
    let tier: String               // "green", "gold", "platinum"
    let accountCount: Int          // Number of accounts in this tier
    let totalStarsBalance: Int     // Sum of current star balances
    let totalLifetimeStars: Int    // Sum of lifetime stars
    let avgStarsBalance: Int       // Average current balance
}

Shows how customers are distributed across tiers:

  • How many customers are in each tier
  • Total and average star balances
  • Growth potential (customers close to next tier)

Star Activity Summary

struct StarTransactionsSummary {
    let starsEarned: Int        // Total stars earned in period
    let starsRedeemed: Int      // Total stars redeemed in period
    let transactionCount: Int   // Number of transactions
}

Tracked for the selected time period (7, 30, or 90 days).

Customer Growth

Two customer metrics:

MethodReturnsDescription
getNewCustomers(days:)IntNew signups in the period
getTotalCustomers()IntAll customer profiles

Key Insights Available

  • Tier health: Are customers progressing through tiers?
  • Earning vs spending: Are customers earning faster than redeeming?
  • Growth rate: How many new customers are signing up?
  • Engagement: Average star balance indicates active usage