Predictive Analytics
Use machine learning predictions for purchase probability, churn risk, and revenue forecasting.
Overview#
JustAnalytics Predictive Analytics uses logistic regression models trained on your site's historical data to predict future user behavior. Predictions help you focus marketing and engagement efforts on the users most likely to convert, churn, or generate revenue.
Prediction Types#
Purchase Probability#
Estimates the likelihood that a visitor will complete a purchase (or conversion goal) within the next 7 days.
How it works:
- The model analyzes behavioral signals: session frequency, pages viewed, events triggered, time on site, and historical conversion patterns
- Each visitor receives a score from 0.0 (unlikely) to 1.0 (very likely)
- Scores update daily as new behavioral data is collected
Use cases:
- Show targeted offers to high-probability visitors
- Exclude likely converters from expensive retargeting campaigns (they will convert anyway)
- Identify "on the fence" visitors (0.3-0.7 score) for nudge campaigns
Churn Probability#
Estimates the likelihood that a returning visitor will not return to your site within the next 28 days.
How it works:
- The model considers: days since last visit, visit frequency trend, engagement depth (pages per session, events per session), and session duration trends
- Visitors who are showing declining engagement patterns receive higher churn scores
- Scores range from 0.0 (likely to return) to 1.0 (likely churned)
Use cases:
- Trigger re-engagement emails for high-churn-risk users
- A/B test retention features targeting at-risk segments
- Track churn risk trends over time to measure retention improvements
Predicted Revenue#
Estimates the total revenue a visitor is expected to generate over the next 28 days.
How it works:
- Combines purchase probability with historical average order values
- Accounts for repeat purchase patterns and spend velocity
- Returns a dollar amount per visitor
Use cases:
- Prioritize support tickets by predicted customer value
- Allocate marketing spend proportionally to predicted revenue segments
- Forecast revenue for the next 28 days
Minimum Data Requirements#
Predictive models require sufficient historical data to generate accurate predictions:
| Requirement | Minimum | Recommended | |-------------|---------|-------------| | Unique visitors | 1,000 | 10,000+ | | Data history | 28 days | 90+ days | | Conversions | 100 | 500+ | | Daily active visitors | 50 | 500+ |
What Happens Below Minimums#
- Below 1,000 visitors: Predictions are unavailable. The dashboard shows a "Not enough data" message with progress toward the minimum.
- Below 28 days: Predictions are unavailable. A countdown shows how many days remain.
- Below 100 conversions: Purchase probability and predicted revenue are unavailable. Churn probability may still work if visitor minimums are met.
Building Toward Predictions#
The Predictions page shows a readiness dashboard:
- Visitor count -- progress bar toward 1,000 minimum
- Data age -- how many days of data you have (target: 28)
- Conversion count -- progress bar toward 100 minimum
- Estimated availability -- projected date when predictions will activate
How the Model Works#
Logistic Regression#
JustAnalytics uses logistic regression for binary classification predictions (will/won't purchase, will/won't churn). Logistic regression is chosen because:
- Interpretable -- feature weights show which behaviors most influence the prediction
- Fast -- predictions compute in milliseconds per visitor
- Robust -- performs well with moderate data volumes (1,000+ samples)
- Stable -- less prone to overfitting than complex models
Feature Engineering#
The model uses these behavioral features:
| Feature | Description |
|---------|-------------|
| session_count_7d | Sessions in the last 7 days |
| session_count_28d | Sessions in the last 28 days |
| pageviews_per_session | Average pageviews per session |
| avg_session_duration | Average session duration (seconds) |
| events_per_session | Average custom events per session |
| days_since_first_visit | Account age in days |
| days_since_last_visit | Recency of last visit |
| conversion_count | Historical conversion count |
| visit_frequency_trend | Is visit frequency increasing or decreasing? |
| bounce_rate | Personal bounce rate across sessions |
| device_type | Desktop, mobile, or tablet |
| channel | Acquisition channel (organic, paid, social, etc.) |
| top_page_category | Most viewed content category |
Model Training#
- Models are retrained weekly (every Sunday at 3:00 AM UTC)
- Training uses the last 90 days of data (or all available data if less)
- A holdout test set (20%) validates accuracy before the model goes live
- If the new model performs worse than the current one, it is discarded
Model Accuracy#
View model performance metrics on the Predictions settings page:
| Metric | Description | Good Target | |--------|-------------|-------------| | AUC-ROC | Area under the ROC curve | > 0.7 | | Precision | True positives / (true positives + false positives) | > 0.5 | | Recall | True positives / (true positives + false negatives) | > 0.5 | | Accuracy | Overall correct predictions | > 0.7 |
Predictive Audiences#
Predictions can be used to create audience segments automatically.
Built-in Predictive Audiences#
When predictions are active, these segments are automatically available:
- Likely Purchasers -- purchase probability > 0.7
- Unlikely Purchasers -- purchase probability < 0.3
- At-Risk (Churn) -- churn probability > 0.7
- Loyal Visitors -- churn probability < 0.3
- High-Value Predicted -- predicted revenue in top 10%
Custom Predictive Audiences#
Create custom audiences based on prediction thresholds:
- Go to Segments and click Create Segment
- Add a condition using Prediction fields:
- Purchase probability greater than 0.5
- Churn probability greater than 0.6
- Predicted revenue greater than $50
- Combine with behavioral conditions (e.g., mobile users with purchase probability > 0.5)
- Save and use across all analytics pages
Using Predictions for Targeting#
Dashboard Integration#
Predictions appear throughout the dashboard:
- Analytics pages -- filter by predictive audience segments
- User detail -- each visitor profile shows prediction scores
- Conversions -- compare conversion rates between predicted segments
- Reports -- include prediction fields as dimensions or filters in Discover
Export for External Targeting#
Export predictive audiences for use in external tools:
- Go to Segments and select a predictive audience
- Click Export Audience
- Download as CSV with visitor identifiers and prediction scores
- Import into your email platform, ad manager, or CRM
Webhook Integration#
Trigger automated workflows when prediction scores change:
POST /api/webhooks
X-API-Key: ja_sk_...
{
"event": "prediction.high_churn",
"threshold": 0.8,
"webhookUrl": "https://your-app.com/handle-churn-risk"
}
When a visitor's churn score exceeds 0.8, the webhook fires with the visitor's data and score.