Views RL Sorting (or A/B Testing)
This module provides a Views sort plugin that uses reinforcement learning to A/B and multivariate test the order of content in any Drupal View. It automatically shifts traffic to higher-performing items based on visitor clicks, offering continuous optimization for dozens or hundreds of items simultaneously without manual intervention. The system supports universal entity types and tracks interactions anonymously for GDPR compliance.
Part of the RL module ecosystem; ships in DXPR CMS.
RL: A/B Test Views Content (rl_sorting) is a Views sort plugin that A/B and multivariate tests the order of any Drupal View using reinforcement learning. Every visitor click is human feedback (RLHF-style); the algorithm continuously shifts traffic to higher-performing items. No fixed test horizons. No manual winner picking. No third-party SaaS.
You need this if
- You want to A/B or multivariate test the order of content in a View (blog posts, products, news items, anything Views can list)
- You want to test dozens or hundreds of items simultaneously, not just A vs B
- You want continuous optimization, not fixed-horizon tests with manual setup
- You want fair exposure for new content without manually rotating it
Features
- Multivariate by default: 2 to thousands of items, no per-test setup
- Universal entity support: nodes, users, taxonomy terms, media, custom entities
- Views integration: a single sort plugin you add to any View display
- Real-time RLHF loop: clicks update the model on every page
- Cold-start handling: new items get exploration scores so they get fair exposure
- Time-based filtering: rolling windows for seasonal or campaign content
- Configurable caching: Views cache lifetime auto-aligned with the RL refresh rate
- Privacy-first tracking: anonymous statistics only, GDPR-compliant
How it works
The sort plugin scores every item in the View using a multi-armed bandit (Thompson Sampling) and routes traffic to higher-performing items. JavaScript on the rendered page records views (turns) and clicks (rewards), feeding the model in real time. The RL core handles the math; this module bridges it to Views.
Post-installation
- Install and enable the RL (Reinforcement Learning) module
- Configure permissions at
/admin/people/permissions - Edit any View display and add "RL: A/B Testing" as the sole sort criterion
- Configure cache refresh rate and time-window options
- Save; content optimization begins immediately
Prefer a turnkey demo site?
Spin up DXPR CMS, Drupal pre-configured with DXPR Builder, DXPR Theme, RL, and security best practices. DXPR CMS is a marketing CMS built for teams that need A/B testing out of the box.
Security & privacy
- GDPR-compliant: only anonymous interaction counts collected
- No personal data: no user identification, cookies, or per-individual tracking
- Local data storage: all data stays on your Drupal site, no external services
Migrating from ai_sorting
This module was renamed from ai_sorting in 2026. Existing installs migrate automatically when you enable rl_sorting; experiment history, Views config, and the legacy module are all handled in hook_install. See the 1.0.0-beta1 release notes for details.
Requires
- RL (Reinforcement Learning) module
- Drupal 10.3+ or 11
Related modules
- RL: A/B & Multivariate Testing (rl): required core engine. Also ships RL: A/B Test Page Titles and RL: A/B Test Menu Links as bundled submodules.
- Views: required Drupal core. rl_sorting registers itself as a Views sort plugin.
- DXPR CMS: ships rl_sorting pre-configured alongside DXPR Builder and DXPR Theme.