Understanding the AI algorithms that learn when your view counter drives conversions
Behind the 🤖 AI Smart visibility mode is a sophisticated machine learning engine that analyzes visitor behavior and sales patterns to optimize when your view counter appears. This article explores the technical mechanics of how the AI learns, calculates recommendations, and continuously adapts.
ℹ️ Technical Article: This article covers the underlying algorithms and data science concepts. For a general overview of AI Adaptive Mode, see How AI Adaptive Mode Works.
🔬 The Learning Algorithm
WhoKnew Views™ Pro’s AI uses a conversion-rate comparison algorithm with exploration-exploitation balancing. While simpler than deep learning approaches, this method is highly effective for the specific problem of visibility optimization.
The Core Question
The algorithm answers one fundamental question:
“Does showing the view counter lead to a higher conversion rate than hiding it?”
It answers this by tracking conversions when the counter is shown vs. hidden, then comparing the resulting conversion rates.
📊 Data Collection: 25+ Data Points Per Visitor
Every time a visitor views a product with AI mode enabled, the system records rich contextual data for pattern analysis:
Time Context (2 Data Points)
hour | 0-23 (hour of day) |
day_of_week | 0-6 (0=Sunday, 6=Saturday) |
Visitor Behavior (10 Data Points)
is_new | 1 = New visitor, 0 = Returning |
is_mobile | 1 = Mobile device, 0 = Desktop |
time_on_site | Seconds since session started |
pages_viewed | Number of pages in this session |
days_since_last_visit | For returning visitors |
has_cart_items | 1 = Cart has items, 0 = Empty |
is_repeat_buyer | 1 = Has previous orders, 0 = No |
traffic_source | organic, paid, direct, or referral |
has_referrer | 1 = Has HTTP referer, 0 = Direct |
session | Session ID for conversion attribution |
Product State (3 Data Points)
total_views | Product’s lifetime view count |
stock_level | out, critical, low, medium, high |
price_tier | budget (<$20), mid, premium, luxury ($100+) |
Counter Display Settings (6 Data Points)
display_count | The number shown to the visitor |
real_views | Actual visitor count |
padded_views | Baseline + variations added |
count_magnitude | single_digit, small, medium, large, massive |
padding_range | Which variation range was used |
has_drift | 1 = Drift animation active, 0 = No |
Decision & Outcome
shown | 1 = Counter was displayed, 0 = Hidden |
preset | Which preset triggered this decision |
🧮 The Conversion Rate Calculation
The AI calculates conversion rates for both visibility states:
Shown Conversion Rate:shown_rate = shown_conversions / shown_total
Hidden Conversion Rate:hidden_rate = hidden_conversions / hidden_total
Recommendation:if shown_rate >= hidden_rate → "show"if hidden_rate > shown_rate → "hide"
💡 Example:
After 50 conversions, suppose:
* 30 conversions happened when the counter was shown (out of 400 views) = 7.5% rate
* 20 conversions happened when the counter was hidden (out of 350 views) = 5.7% rate
Since 7.5% > 5.7%, the AI recommends: “SHOW”
📈 Confidence Scoring
The AI doesn’t just make a recommendation—it calculates a confidence score to indicate how reliable that recommendation is.
Confidence Formula
Confidence is calculated from two components, each contributing up to 50%:
1. Sample Size Confidence (0-50%):sample_confidence = min(50, (total_conversions / 100) × 50)
2. Rate Difference Confidence (0-50%):rate_diff = abs(shown_rate - hidden_rate) × 100diff_confidence = min(50, (rate_diff / 10) × 50)
Total Confidence:confidence = sample_confidence + diff_confidence
Interpreting Confidence
| Confidence Range | Meaning |
|---|---|
| 0-25% | Low confidence — small sample, small rate difference |
| 25-50% | Moderate confidence — emerging patterns |
| 50-75% | Good confidence — clear signal from data |
| 75-100% | High confidence — large sample + big rate difference |
🔄 Exploration vs. Exploitation
A key challenge in machine learning is balancing exploitation (using what you’ve learned) with exploration (testing to discover new patterns).
WhoKnew Views™ Pro uses an Epsilon-Greedy approach:
90/10 Split:
- 90% Exploitation — Use the learned recommendation
- 10% Exploration — Random 50/50 decision to keep collecting fresh data
Why 10% Exploration?
Customer behavior changes over time due to:
- 🎄 Seasonal shifts — Holiday shopping vs. normal periods
- 📱 Technology changes — New devices, browser updates
- 🛒 Market trends — Competitor changes, economic factors
- 🆕 New products — Different product types may behave differently
The 10% exploration rate ensures the AI continuously adapts rather than getting stuck on outdated patterns.
🧠 Context-Aware Pattern Matching
Beyond the base recommendation, the AI applies real-time context optimizations based on learned patterns:
1. Time-Based Optimization
The AI tracks which hours produce the most conversions:
if (current_hour ∈ best_converting_hours) → always_show = true
If the AI learns that conversions spike at 9 PM, it will always show the counter at 9 PM, regardless of other factors.
2. New Visitor Optimization
Tracks whether new visitors respond differently to social proof:
if (is_new_visitor && new_visitor_shown > 20 && new_visitor_shown > new_visitor_hidden × 1.2)→ override to SHOW
Requires 20+ data points and a 20% performance advantage before overriding.
3. Mobile Optimization
Mobile users may prefer cleaner interfaces:
if (is_mobile && mobile_hidden > 20 && mobile_hidden > mobile_shown × 1.2)→ override to HIDE
4. Low Stock Override
Scarcity + social proof is a powerful combination:
if (stock_quantity !== null && stock_quantity < 10)→ always_show = true // Urgency override
5. Weekend/Weekday Patterns
Shopping behavior often differs on weekends:
if (is_weekend && weekend_data_count > 40)weekend_rate = weekend_shown / (weekend_shown + weekend_hidden)if (weekend_rate > 0.6) → showif (weekend_rate < 0.4) → hide
💾 Data Storage & Retention
The AI uses a two-tier storage system that balances detail with efficiency:
Tier 1: Detailed Records (0-90 Days)
- 📊 Full 25+ data points per visibility decision
- 🔍 Enables granular pattern analysis
- 📁 Stored in
_wkv_counter_shown_timespost meta
Tier 2: Aggregated Summaries (91 Days – 5 Years)
- 📈 Daily counts for each context dimension
- 💡 Preserves long-term patterns without database bloat
- 📁 Stored in
_wkv_daily_visibility_aggregatespost meta
Aggregated Metrics Include:
| Basic Counts | shown, hidden |
| Visitor Type | new_visitors_shown, new_visitors_hidden |
| Device | mobile_shown, mobile_hidden |
| Day Type | weekend_shown, weekend_hidden |
| Stock State | low_stock_shown, low_stock_hidden |
| Engagement | engaged_visitors_shown, quick_browsers_shown, etc. |
| Cart Status | with_cart_shown, with_cart_hidden |
| Customer Type | repeat_buyers_shown, repeat_buyers_hidden |
| Traffic Source | paid_traffic_shown, paid_traffic_hidden |
| Browse Depth | deep_browsers_shown, deep_browsers_hidden |
| Counter Size | high_count_shown, low_count_shown, etc. |
| Animation | with_drift_shown, with_drift_hidden |
🌐 Site-Wide Learning Architecture
Unlike per-product learning (which would require thousands of views per product), WhoKnew Views™ Pro uses site-wide learning:
✅ Benefits of Site-Wide Learning:
- 🚀 Faster convergence — Aggregating across products reaches 50 conversions quickly
- 📊 Better statistics — Larger sample sizes mean more reliable patterns
- 🔄 Universal application — All products benefit from collective learning
- 🆕 New product advantage — New products immediately use learned patterns
How Site-Wide Aggregation Works
- AI queries all products with visibility data for the active preset
- Aggregates
shown_totalandhidden_totalacross all products - Matches visibility data with conversion data by date
- Calculates site-wide conversion rates
- Applies the recommendation to any product using that preset
⚡ Performance Considerations
The AI engine is designed for minimal performance impact:
- 📦 No extra database tables — Uses existing WordPress post meta
- ⏱️ Deferred aggregation — Runs via daily cron, not on page load
- 🎯 Lightweight decisions — Simple comparison, not neural network inference
- 🗑️ Automatic cleanup — Data older than 5 years is purged automatically
📊 Monitoring AI Performance
Check AI learning status in WhoKnew → System Info:
- 📈 AI Status — Learning or Trained
- 🔢 Conversions Tracked — X / 50 (training threshold)
- 📊 Conversion Rates — Shown rate vs. Hidden rate
- 💯 Confidence Level — How reliable the recommendation is
- 🎯 Current Recommendation — SHOW or HIDE
- 📉 Performance Multiplier — How much better the winning option performs