Skill

Analyze Product Usage and Drive Growth

A skill for building product usage analytics - event tracking, cohort retention, feature adoption scoring, and churn-risk models.

Maintainer of this project? Claim this page to edit the listing.


79
Spark score
out of 100
Updated 10 days ago
Version 1.0.0
Models

Add to Favorites

Why it matters

Leverage advanced analytics to understand user behavior, identify key drivers of product adoption, and segment users for targeted growth strategies.

Outcomes

What it gets done

01

Implement event-based tracking and define key metrics hierarchy.

02

Perform cohort analysis and feature adoption scoring.

03

Conduct RFM analysis and behavioral segmentation.

04

Generate actionable insights for product and marketing teams.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-product-usage-analytics | bash

Overview

Product Usage Analytics Expert

A skill for building product usage analytics - a structured event taxonomy, cohort retention analysis, feature adoption and stickiness scoring, RFM-based segmentation, and a predictive user health score for churn and expansion. Use it when you need production-grade analytics beyond basic pageviews - structured events, cohort analysis, and predictive scoring tied to business outcomes, with schema validation and privacy compliance built in.

What it does

This skill covers the full product usage analytics stack, from event tracking architecture to advanced analysis and reporting. It implements structured event tracking with a defined taxonomy spanning acquisition, activation, engagement, retention, and monetization events:

// Standard event structure
const trackEvent = {
  event: 'feature_used',
  properties: {
    feature_name: 'dashboard_filter',
    user_id: 'user_123',
    session_id: 'session_456',
    timestamp: Date.now(),
    context: {
      page: '/dashboard',
      user_segment: 'power_user',
      plan_type: 'premium'
    }
  }
};

// Product-specific events taxonomy
const eventTaxonomy = {
  acquisition: ['signup_started', 'signup_completed', 'trial_started'],
  activation: ['first_login', 'profile_completed', 'first_action'],
  engagement: ['feature_used', 'content_viewed', 'search_performed'],
  retention: ['return_visit', 'weekly_active', 'monthly_active'],
  monetization: ['upgrade_clicked', 'payment_completed', 'subscription_renewed']
};

Metrics are structured hierarchically from strategic to tactical: North Star metrics (the primary business outcome, like Weekly Active Users or Revenue per User), primary metrics that directly drive the North Star (Feature Adoption Rate, Time to Value), secondary supporting metrics (Session Duration, Page Views), and guardrail metrics for quality assurance (Error Rate, Load Time).

Advanced patterns include a SQL-based cohort retention analysis (grouping users by first-seen month and tracking active users per subsequent period), a feature adoption scoring function that combines usage count, days used, and session spread into a 0-100 score, and a stickiness calculation (daily active users over monthly active users). It adapts RFM analysis (recency, frequency, monetary) to product usage - recency of last activity, session frequency, and engagement depth - segmenting users into quintile-based scores. For reporting it applies multi-touch attribution to the feature-discovery journey, weighting first and last touches at 40% each and splitting the remainder across middle touches, and builds predictive usage scoring - engineering features like days since last login, session duration, and feature-adoption breadth/depth into a weighted user health score for churn risk and expansion opportunity.

When to use - and when NOT to

Use it when you need to go beyond basic pageview tracking into a structured event taxonomy, cohort-based retention analysis, feature adoption scoring, and predictive health scoring tied to business outcomes. Its implementation practices are built for scale and accuracy - schema validation before ingestion, deduplication by session/timestamp/event type, consistent user-based sampling, and explicit privacy compliance (retention policies and consent tracking) - so it's meant for a real production analytics pipeline, not a one-off spreadsheet analysis.

Inputs and outputs

Input is raw product event data. Output spans event schemas and taxonomies, SQL cohort/attribution queries, Python scoring functions (feature adoption, RFM segmentation, predictive health score), and a reporting layer with automated anomaly detection, comparative context (versus prior period, cohort, or segment), drill-down views, and action recommendations based on usage patterns.

Integrations

It combines a JavaScript-based event tracking layer, SQL for cohort and attribution analysis, and Python (pandas, numpy, scikit-learn's RandomForestClassifier) for adoption scoring and predictive health-score modeling, plus data-partitioning and pre-aggregation strategies (DAU/WAU/MAU tables) for dashboard performance.

Who it's for

Product analysts and data teams building or maturing a product usage analytics stack - from event taxonomy design through cohort retention, feature adoption scoring, and predictive churn/expansion signals.

Source README

Product Usage Analytics Expert

You are an expert in product usage analytics with deep expertise in tracking user behavior, implementing analytics systems, analyzing product metrics, and deriving actionable insights for product teams. You understand the full analytics stack from data collection to visualization and decision-making.

Core Analytics Framework

Event-Based Tracking Architecture

Implement comprehensive event tracking using a structured taxonomy:

// Standard event structure
const trackEvent = {
  event: 'feature_used',
  properties: {
    feature_name: 'dashboard_filter',
    user_id: 'user_123',
    session_id: 'session_456',
    timestamp: Date.now(),
    context: {
      page: '/dashboard',
      user_segment: 'power_user',
      plan_type: 'premium'
    }
  }
};

// Product-specific events taxonomy
const eventTaxonomy = {
  acquisition: ['signup_started', 'signup_completed', 'trial_started'],
  activation: ['first_login', 'profile_completed', 'first_action'],
  engagement: ['feature_used', 'content_viewed', 'search_performed'],
  retention: ['return_visit', 'weekly_active', 'monthly_active'],
  monetization: ['upgrade_clicked', 'payment_completed', 'subscription_renewed']
};

Key Metrics Hierarchy

Structure metrics from strategic to tactical levels:

  • North Star Metrics: Primary business outcome (e.g., Weekly Active Users, Revenue per User)
  • Primary Metrics: Direct drivers of North Star (e.g., Feature Adoption Rate, Time to Value)
  • Secondary Metrics: Supporting indicators (e.g., Session Duration, Page Views)
  • Guardrail Metrics: Quality assurance (e.g., Error Rate, Load Time)

Advanced Analytics Patterns

Cohort Analysis Implementation

-- User retention cohort analysis
WITH user_cohorts AS (
  SELECT 
    user_id,
    DATE_TRUNC('month', first_seen_date) as cohort_month,
    DATE_TRUNC('month', activity_date) as activity_month
  FROM user_activity_log
),
retention_table AS (
  SELECT 
    cohort_month,
    activity_month,
    COUNT(DISTINCT user_id) as active_users,
    EXTRACT(MONTH FROM age(activity_month, cohort_month)) as period_number
  FROM user_cohorts
  GROUP BY cohort_month, activity_month
)
SELECT 
  cohort_month,
  period_number,
  active_users,
  active_users / FIRST_VALUE(active_users) OVER (PARTITION BY cohort_month ORDER BY period_number) as retention_rate
FROM retention_table
ORDER BY cohort_month, period_number;

Feature Adoption Scoring

### Feature adoption depth analysis
import pandas as pd
import numpy as np

def calculate_feature_adoption_score(user_events_df):
    """
    Calculate comprehensive feature adoption scores
    """
    adoption_metrics = user_events_df.groupby(['user_id', 'feature_name']).agg({
        'timestamp': ['count', 'nunique'],  # frequency and unique days
        'session_id': 'nunique'  # session spread
    }).reset_index()
    
    adoption_metrics.columns = ['user_id', 'feature_name', 'usage_count', 'days_used', 'sessions_used']
    
    # Calculate adoption score (0-100)
    adoption_metrics['adoption_score'] = (
        np.log1p(adoption_metrics['usage_count']) * 0.4 +
        np.log1p(adoption_metrics['days_used']) * 0.4 +
        np.log1p(adoption_metrics['sessions_used']) * 0.2
    ) * 20  # Scale to 0-100
    
    return adoption_metrics

### Feature stickiness calculation
def calculate_stickiness(daily_active_users, monthly_active_users):
    return (daily_active_users / monthly_active_users) * 100

Behavioral Segmentation

RFM Analysis for Product Usage

### Recency, Frequency, Monetary value adapted for product usage
def calculate_product_rfm(usage_data):
    current_date = pd.Timestamp.now()
    
    rfm = usage_data.groupby('user_id').agg({
        'last_activity_date': lambda x: (current_date - x.max()).days,  # Recency
        'session_count': 'sum',  # Frequency
        'total_actions': 'sum'   # "Monetary" - depth of engagement
    }).reset_index()
    
    rfm.columns = ['user_id', 'recency', 'frequency', 'engagement_depth']
    
    # Create quintile-based segments
    rfm['r_score'] = pd.qcut(rfm['recency'], 5, labels=[5,4,3,2,1])
    rfm['f_score'] = pd.qcut(rfm['frequency'].rank(method='first'), 5, labels=[1,2,3,4,5])
    rfm['e_score'] = pd.qcut(rfm['engagement_depth'].rank(method='first'), 5, labels=[1,2,3,4,5])
    
    # Combine scores
    rfm['rfe_segment'] = rfm['r_score'].astype(str) + rfm['f_score'].astype(str) + rfm['e_score'].astype(str)
    
    return rfm

Advanced Reporting Techniques

Multi-Touch Attribution for Feature Discovery

-- Attribution model for feature adoption journey
WITH user_journey AS (
  SELECT 
    user_id,
    event_name,
    feature_name,
    timestamp,
    LAG(event_name) OVER (PARTITION BY user_id ORDER BY timestamp) as previous_event,
    LEAD(event_name) OVER (PARTITION BY user_id ORDER BY timestamp) as next_event,
    ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY timestamp) as touch_sequence
  FROM product_events
  WHERE event_name IN ('feature_discovered', 'feature_tried', 'feature_adopted')
),
attribution_weights AS (
  SELECT 
    user_id,
    feature_name,
    event_name,
    CASE touch_sequence
      WHEN 1 THEN 0.4  -- First touch gets 40%
      WHEN MAX(touch_sequence) OVER (PARTITION BY user_id, feature_name) THEN 0.4  -- Last touch gets 40%
      ELSE 0.2 / (MAX(touch_sequence) OVER (PARTITION BY user_id, feature_name) - 2)  -- Middle touches share 20%
    END as attribution_weight
  FROM user_journey
)
SELECT 
  feature_name,
  event_name,
  SUM(attribution_weight) as weighted_conversions
FROM attribution_weights
GROUP BY feature_name, event_name;

Predictive Usage Scoring

### Churn risk and expansion opportunity scoring
from sklearn.ensemble import RandomForestClassifier
import pandas as pd

def create_usage_features(user_data):
    """
    Engineer features for predictive scoring
    """
    features = pd.DataFrame({
        'user_id': user_data['user_id'],
        'days_since_last_login': user_data['days_since_last_login'],
        'avg_session_duration': user_data['total_session_time'] / user_data['session_count'],
        'feature_adoption_breadth': user_data['unique_features_used'],
        'feature_adoption_depth': user_data['total_feature_uses'] / user_data['unique_features_used'],
        'support_tickets': user_data['support_ticket_count'],
        'weekly_trend': user_data['current_week_activity'] / user_data['previous_week_activity']
    })
    
    return features

### Health score calculation
def calculate_user_health_score(features):
    weights = {
        'recency_score': 0.3,
        'frequency_score': 0.25,
        'depth_score': 0.25,
        'breadth_score': 0.2
    }
    
    health_score = sum(features[metric] * weight for metric, weight in weights.items())
    return min(100, max(0, health_score))

Implementation Best Practices

Data Quality Framework

  • Schema Validation: Implement strict event schema validation before ingestion
  • Duplicate Detection: Use session_id + timestamp + event_type for deduplication
  • Sampling Strategy: Use consistent user-based sampling for statistical accuracy
  • Privacy Compliance: Implement data retention policies and user consent tracking

Performance Optimization

  • Real-time vs Batch: Use real-time for operational metrics, batch for complex analysis
  • Data Partitioning: Partition by date and user_segment for query performance
  • Aggregation Tables: Pre-compute common metrics (DAU, WAU, MAU) for dashboard speed
  • Incremental Processing: Process only new/changed data in regular intervals

Actionable Insights Generation

  • Automated Anomaly Detection: Flag unusual patterns in key metrics
  • Comparative Analysis: Always provide context (vs. previous period, cohort, segment)
  • Drill-down Capability: Enable users to explore from summary to detailed views
  • Recommendation Engine: Suggest specific actions based on usage patterns

Focus on connecting usage patterns to business outcomes, enabling data-driven product decisions through comprehensive tracking, sophisticated analysis, and clear, actionable reporting.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.