Skip to content

FOMO Notifications

FOMO (Fear of Missing Out) notifications create social proof by showing fake purchase notifications, encouraging visitors to take action based on seeing others’ purchases.

The simplest way to start FOMO notifications:

// Wait for SDK to be fully initialized
window.addEventListener('next:initialized', function() {
console.log('SDK initialized, starting FOMO popups...');
// Simple usage - starts immediately with defaults
next.fomo();
// Optional: Listen to events for analytics
next.on('fomo:shown', (data) => {
console.log('FOMO shown:', data.customer, 'purchased', data.product);
});
});

Customize timing and behavior:

next.fomo({
initialDelay: 2000, // Start after 2 seconds
displayDuration: 5000, // Show for 5 seconds
delayBetween: 10000, // 10 seconds between popups
maxMobileShows: 3 // Limit to 3 popups on mobile
});
ParameterTypeDescriptionDefault
initialDelaynumberDelay before first popup (milliseconds)0
displayDurationnumberHow long to show each popup (milliseconds)5000
delayBetweennumberTime between popups (milliseconds)12000
maxMobileShowsnumberMaximum popups on mobile devices2
itemsArray<{text, image}>Custom products to showCampaign products
customersObjectCustomer names by country codeDefault names
countrystringForce specific countryAuto-detected
// Start FOMO notifications
function startFomo() {
next.fomo({
initialDelay: 2000,
displayDuration: 5000,
delayBetween: 10000
});
}

Define specific products to show in notifications:

next.fomo({
items: [
{
text: "Premium Bundle - Save 30%",
image: "https://example.com/premium-bundle.jpg"
},
{
text: "Starter Pack",
image: "https://example.com/starter-pack.jpg"
},
{
text: "Ultimate Collection",
image: "https://example.com/ultimate.jpg"
}
],
displayDuration: 4000,
delayBetween: 15000
});

Provide localized customer names for different regions:

next.fomo({
customers: {
US: ["Sarah from Dallas", "Mike from Boston", "Lisa from Miami"],
CA: ["Jean from Montreal", "Pierre from Quebec", "Marie from Toronto"],
GB: ["Oliver from London", "Emma from Manchester", "James from Leeds"],
AU: ["Liam from Sydney", "Olivia from Melbourne", "Noah from Brisbane"]
},
maxMobileShows: 3,
initialDelay: 0 // Start immediately
});
function customFomo() {
next.fomo({
// Products to rotate through
items: [
{
text: "Premium Bundle - Save 30%",
image: "https://example.com/premium-bundle.jpg"
},
{
text: "Starter Pack",
image: "https://example.com/starter-pack.jpg"
}
],
// Customer names by country
customers: {
US: ["Sarah from Dallas", "Mike from Boston", "Lisa from Miami"],
CA: ["Jean from Montreal", "Pierre from Quebec", "Marie from Toronto"]
},
// Timing configuration
maxMobileShows: 3, // Show max 3 times on mobile
displayDuration: 4000, // Show for 4 seconds
delayBetween: 15000, // 15 seconds between popups
initialDelay: 0, // Start immediately
// Force specific country (optional)
country: 'US'
});
}
// Initialize on page load
window.addEventListener('next:initialized', customFomo);

Listen to FOMO events for analytics tracking:

// Popup shown
next.on('fomo:shown', (data) => {
console.log('FOMO popup displayed');
console.log('Customer:', data.customer);
console.log('Product:', data.product);
console.log('Image:', data.image);
// Track with analytics
gtag('event', 'fomo_shown', {
customer: data.customer,
product: data.product
});
});

Event Data:

  • customer (string) - Customer name shown
  • product (string) - Product name shown
  • image (string) - Product image URL

The FOMO popup has default styles but can be fully customized with CSS:

<div class="next-fomo-wrapper">
<div class="next-fomo-inner">
<div class="next-fomo-item">
<div class="next-fomo-thumb">
<img class="next-fomo-image" alt="Product">
</div>
<div class="next-fomo-desc">
<p>
<span class="next-fomo-customer"></span><br>
Just purchased:<br>
<span class="next-fomo-product"></span><br>
<span class="next-fomo-time">JUST NOW</span>
</p>
</div>
</div>
</div>
</div>
/* Override default styles */
.next-fomo-wrapper {
bottom: 20px;
left: 20px;
width: 320px;
background: white;
border-radius: 10px;
box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
/* Customize text */
.next-fomo-customer {
font-weight: 600;
color: #000;
}
.next-fomo-product {
font-weight: 600;
color: #333;
}
.next-fomo-time {
font-size: 11px;
color: #999;
text-transform: uppercase;
}
  1. Realistic Timing

    • Use realistic delays between notifications (12-20 seconds)
    • Don’t show popups too frequently - it reduces credibility
  2. Mobile Limits

    • Keep maxMobileShows low (2-3) on mobile devices
    • Mobile users are more sensitive to interruptions
  3. Relevant Products

    • Show products related to the current page or category
    • Match notification products to user’s browsing context
  4. Geographic Matching

    • Use customer names from the target region
    • Increases believability and relatability
  5. Balance UX

    • Don’t overuse FOMO - it can annoy users
    • Stop notifications on checkout/thank you pages
    • Consider disabling after user interaction
window.addEventListener('next:initialized', function() {
// Only show FOMO on product pages
const pageType = document.querySelector('meta[name="next-page-type"]')?.content;
if (pageType === 'product') {
next.fomo({
initialDelay: 3000,
displayDuration: 4000,
delayBetween: 12000,
maxMobileShows: 2
});
}
});

Show notifications for products related to what the user is viewing:

// Get current product being viewed
const currentProductId = document.querySelector('[data-next-package-id]')?.dataset.nextPackageId;
const currentProductImage = document.querySelector('[data-next-display="package.image"]')?.src;
const currentProductName = document.querySelector('[data-next-display="package.name"]')?.textContent;
// Show FOMO for current and related products
next.fomo({
items: [
{
text: currentProductName || "Popular Product",
image: currentProductImage || "/images/placeholder.jpg"
}
],
initialDelay: 5000,
displayDuration: 5000
});
// Different products for different categories
const category = window.location.pathname.split('/')[1];
const categoryProducts = {
supplements: [
{ text: "Protein Powder - Chocolate", image: "/images/protein.jpg" },
{ text: "Pre-Workout Formula", image: "/images/preworkout.jpg" }
],
apparel: [
{ text: "Performance T-Shirt", image: "/images/shirt.jpg" },
{ text: "Training Shorts", image: "/images/shorts.jpg" }
]
};
next.fomo({
items: categoryProducts[category] || [],
displayDuration: 4000,
delayBetween: 15000
});

Disable FOMO notifications when user reaches checkout to avoid distraction:

// Initialize FOMO
window.addEventListener('next:initialized', function() {
if (!window.location.pathname.includes('checkout')) {
next.fomo({
initialDelay: 2000,
displayDuration: 5000,
delayBetween: 12000
});
}
});
// Stop on checkout navigation
next.on('checkout:started', function() {
next.stopFomo();
});

Show FOMO only during specific hours:

function shouldShowFomo() {
const hour = new Date().getHours();
// Show between 9 AM and 9 PM
return hour >= 9 && hour < 21;
}
window.addEventListener('next:initialized', function() {
if (shouldShowFomo()) {
next.fomo({
initialDelay: 3000,
displayDuration: 5000,
delayBetween: 15000
});
}
});

If you don’t provide custom customer names, these defaults are used:

["Grace from New York", "Hailey from Sacramento", "Phoebe from Las Vegas", "Jenny from Scottsdale"]
  1. Check that SDK is initialized: window.next should be defined
  2. Verify campaign has products with images (required for default items)
  3. Check browser console for errors
  4. Ensure next.fomo() is called after next:initialized event
// Increase delay between popups
next.fomo({
delayBetween: 20000 // 20 seconds instead of default 12
});
// Or limit total shows on mobile
next.fomo({
maxMobileShows: 1 // Show only once on mobile
});
// Ensure images have valid URLs and are accessible
next.fomo({
items: [
{
text: "Product Name",
image: "https://full-url-to-image.jpg" // Must be complete URL
}
]
});