EngageBox
v6.3.8
-
- 3 Ways to Trigger a Box on Click
- AdBlock Detect Trigger
- Click Trigger
- Display a popup before user leaves your website
- Display a popup when a certain element reaches your browser's viewport
- Element Visibility Trigger
- EngageBox Popup Triggers
- Exit-Intent Trigger
- External Link Click
- Hover Trigger
- Idle (Inactivity Detection)
- OnClick Trigger
- Page Load Trigger
- Page Ready Trigger
- Scroll Depth Trigger
-
- AcyMailing List Condition
- Browser
- City
- Component Condition
- Continent Condition
- Convert Forms Conditions
- Cookie Condition
- Country Condition
- Date Condition
- Day of Week
- Device Condition
- Display Conditions
- E-Commerce Conditions (VirtueMart - HikaShop)
- EngageBox - Viewed Another Popup Condition
- Homepage
- IP Address Condition
- Joomla! Content Article Condition
- Joomla! Content Category Condition
- Joomla! Content Component View Condition
- K2 Category
- K2 Item
- K2 Page Type
- K2 Tag
- Language
- Menu Item
- Month
- New/Returning Visitor Condition
- Operating System
- Pageviews Condition
- PHP
- Referrer URL Condition
- Region
- Time on Site
- Time Range
- Trigger based on URL match
- URL Condition
- User Access Level Condition
- User Condition
- User Group
-
- Create a AcyMailing Optin Box
- Create a Breezing Forms Popup
- Create a Facebook Like Page Box
- Create a GetResponse Optin Box
- Create a MailChimp Optin Box
- Create a SalesForce Optin Box
- Create a Twitter Follow Button Box
- Create a Vimeo Video Popup
- Create a YouTube Video Popup
- Create an RSForm Popup
- Display a Joomla Article In a Popup
- Display a Joomla Module in a Popup (Modal)
- Display Google Map in a Popup
- Google Analytics Integration
- Load Convert Forms through EngageBox
-
- Randomly Rotate Popups on a Page
- Αdd Sound Effects to Your Popups
- Make Accessible Popups
- Add a Countdown timer in your popup
- Limit impressions per unique visitor
- Test the responsiveness of your boxes for various devices and viewports
- Open a box by clicking on a menu item
- Trigger based on the minimum time visitor spent on the site
- Auto-Close popup after a specific time
- Open a box using HTML Attributes
Randomly Rotate Popups on a Page
Show just one popup from a group at random—ideal for testing variations or keeping your page clean without overwhelming visitors.
Want to display only one of several popups on a page, selected at random? Whether you’re experimenting with different content or simply trying to avoid showing multiple popups at once, there’s a simple way to control this behavior. While EngageBox doesn’t offer built-in A/B testing, you can replicate this logic using a short script.
Steps
First, publish all the popups you want to include in the rotation. Ensure they’re assigned to the same page so they’re all loaded and available for selection.
Next, add the following JavaScript to your site:
EngageBox.onReady(() => {
// Array of popup IDs we want to manage
const popups = [3, 4, 5];
// Randomly select one popup ID from the array
const randomId = popups[Math.floor(Math.random() * popups.length)];
// Iterate through all popup IDs
popups.forEach(popupId => {
// Skip the randomly selected popup ID
// This popup will be allowed to display normally
if (popupId === randomId) {
return;
}
// Get the EngageBox instance for the current popup ID
const popup = EngageBox.getInstance(popupId);
// If the popup instance doesn't exist, skip to the next one
if (popup === undefined) {
return;
}
// Add an event listener for the 'beforeOpen' event
// and prevent the popup from opening
popup.on('beforeOpen', () => {
return false;
});
});
});
Notes
- All popups must be published on the same page for this method to work. If a popup is not loaded on the page, it won’t be available for EngageBox to control.
- You can use any of the supported trigger points—On Page Load, Exit Intent, Scroll, Click, etc. It does not matter. The script will still prevent non-selected popups from opening.
- There is no limit to the number of popups you can include in the random rotation. Simply add all the popup IDs to the popupIds array.
- This approach does not offer built-in tracking or conversion statistics but provides a simple way to rotate content without showing everything at once.
Last updated on May 15th 2025 09:05