FCHubFCHub.co

Reports & Analytics

Dashboard analytics with member counts, plan distribution, churn analysis, revenue tracking, and content popularity metrics.

FCHub Memberships includes a built-in analytics system that tracks membership metrics over time. Data is aggregated daily via cron and served through REST API endpoints to the admin dashboard.

Overview Dashboard

The reports overview shows key metrics at a glance:

MetricDescription
Active MembersTotal number of users with at least one active grant
Active PlansNumber of plans with status active
Content ProtectedTotal number of protection rules configured
Grants This MonthNew grants created in the current calendar month
New This MonthNew unique members this month
Churned This MonthMembers who lost access this month (expired, revoked)
Churn RatePercentage: churned / (active + churned) * 100

These metrics are calculated in real-time from the grants table by the MemberStatsReport::getOverview() method.

Members Over Time

A time-series chart showing total active member count over a configurable period. The data comes from the stats_daily table, which is populated by the daily aggregation cron.

Available periods:

  • 30d — last 30 days
  • 6m — last 6 months
  • 12m — last 12 months

Each data point represents the total active member count on that date, aggregated across all plans.

Plan Distribution

A breakdown of active members by plan, showing:

FieldDescription
Plan TitleName of the membership plan
Member CountNumber of unique active users with grants for this plan

This helps you understand which plans are most popular and identify opportunities for upselling or plan restructuring. Plans are sorted by member count in descending order.

Churn Analysis

The ChurnReport class provides detailed churn data:

  • Monthly churn rate over time
  • Churn by plan (which plans have the highest churn)
  • Churn reasons (expiration vs. revocation vs. cancellation)

Churn is calculated as the number of members who transitioned from active to expired or revoked within a given period.

Revenue by Plan

Revenue tracking links membership grants to FluentCart order totals:

FieldDescription
PlanMembership plan name
Daily RevenueSum of order totals for grants created that day
Monthly RevenueAggregate revenue for the month

Revenue is calculated by joining the grants table with FluentCart's orders table (fct_orders) where source_type = 'order' and matching the grant's source_id to the order ID. Amounts are converted from FluentCart's internal cent storage to whole currency units before display.

Currency

Revenue figures use your FluentCart store currency — symbol, position, and decimal separator are all pulled from the store settings automatically. No hardcoded dollar signs.

Revenue Accuracy

Revenue figures reflect the total order amount at the time of grant creation. For subscriptions with multiple payments, only the initial order amount is captured in the grant. Subscription renewal revenue is tracked separately through FluentCart's own reporting.

Content Popularity

The ContentPopularityReport tracks which protected content items receive the most access:

  • Most accessed protected pages
  • Content with the highest number of unique member views
  • Content that drives the most new sign-ups

This helps you understand what content is most valuable to your members and can inform your content creation strategy.

Daily Aggregation

The fchub_memberships_daily_stats cron runs daily and calls MemberStatsReport::aggregateDaily(). This method:

  1. Iterates through all plans
  2. For each plan, counts active members, new members, churned members, and daily revenue
  3. Inserts or updates a row in the stats_daily table for today's date and this plan
  4. Aggregates totals (with plan_id = 0) for all-plan summaries

The aggregation also triggers the MembershipAnniversaryTrigger::checkAnniversaries() method, which checks for grant anniversaries and fires FluentCRM triggers.

Stats Table Schema

ColumnTypeDescription
stat_dateDATEThe date for this row
plan_idBIGINTPlan ID (0 = aggregate across all plans)
active_countINTActive member count on this date
new_countINTNew members on this date
churned_countINTChurned members on this date
revenueBIGINTRevenue in the smallest currency unit

The table has a unique index on (stat_date, plan_id) to ensure one row per plan per day.

REST API Endpoints

Reports are exposed through the REST API under the fchub-memberships/v1 namespace:

EndpointMethodDescription
/reports/overviewGETDashboard overview metrics
/reports/members-over-timeGETTime-series member count (accepts period param)
/reports/plan-distributionGETActive members by plan
/reports/churnGETChurn analysis data
/reports/revenueGETRevenue by plan
/reports/content-popularityGETMost accessed protected content

All report endpoints require manage_options capability.

WP-CLI Stats

You can also pull stats from the command line:

# Overview stats
wp fchub-membership stats

# Stats for a specific period
wp fchub-membership stats --period=30d

# Force daily aggregation
wp fchub-membership stats --aggregate

The stats command outputs a formatted table with the overview metrics and optionally triggers the daily aggregation.

On this page