All Collections
Segmentation & Insights and Onsite Content Personalization
Increase conversion with Social Proof & FOMO messaging in Nosto
Increase conversion with Social Proof & FOMO messaging in Nosto

How to add more urgency to PDPs by exposing data about views, carts, buys, etc

Dan Macarie avatar
Written by Dan Macarie
Updated over a week ago


anxiety that an exciting or interesting event may currently be happening elsewhere, often aroused by posts seen on social media."

Social proofing, FOMO messaging, urgency messaging.... whatever you want to call it, this kind of messaging is commonplace in ecommerce nowadays and like it or not: it is here to stay.

Creating FOMO with Nosto

Using some basic variables and HTML through nosto you can now expose product attributes in both Recommendations and On-Site Content Campaigns to increase customer FOMO and thus the likelihood of a conversion from your given campaign. Views, Buys, Discount Level & Stock level can all be exposed on pages with relative ease using the below variables




viewedProduct.inventoryLevel // getViewedProduct().getInventoryLevel() // getViewedProduct().getDiscount().percent

When calling a nosto product attribute in a content campaign, we need to put the request into context of the page that’s being viewed. To do this we use $!context.getViewedProduct() variable to tell nosto that we need the views, buys, stock, discount for the product that is currently being viewed. Once we have set the context and requested the score, we can then use the returned value in our campaigns.

You can find a full list of the nosto variables available for use here:

Exposing View & Buy Scores

Nosto tracks view and buy "scores" for products by default as part of our standard tracking. The view and buy score for each product is then stored within nosto as an attribute that can be used in campaigns.



Views and Buys are scored on an hourly basis and can be called at the following intervals for example: 1hr, 24hrs, 168hrs (1 week), 720hrs (30 days).

In order to expose the views/buys for a given time period, you must first ensure the time period is set up in the account. To do this navigate to Tools > Time Periods and add your given time period.

The time value is inputted to the parentheses and what is returned will be the view or the buy score for the given time period.

For example product.scores.get(24).views will return the number of views a product has received in the last day. Similarly product.scores.get(168).buys will expose the number of buys in the last week for a given product.

The below campaign could be used on a product page to show the number of views in the last day.

<div id="views" class="nosto-fomo">$!context.viewedProduct.scores.get(24).views views in the last 24hrs!</div>

Adding conditions

What if a product doesn't have many views? Or is hasn't been bought many times? Can you hide the campaign based on this?

Yes. You can wrap these campaigns in an #if statement based on your requirements. By wrapping the whole campaign in an #if statement nosto can conditionally show the campaign based on the score.

Only show fomo content if product has 10 or more views

#if ($!context.viewedProduct.scores.get(720).views >= 10)

<div id="views" class="nosto-fomo">$!context.viewedProduct.scores.get(720).views views in the last 24hrs!</div>


Exposing Stock Levels

If you are sending inventory level to nosto either via Shopify, Magento or the Products API you will be able to expose the available stock level using the following variable.


The below campaign will print the available inventory to the page #if the inventory is less 10, but more than or equal to 1.

#if ($!context.getViewedProduct().getInventoryLevel() <= 10 && $!context.getViewedProduct().getInventoryLevel() >= 1)

<div id="stock" class="nosto-fomo">Hurry, Only $!context.getViewedProduct().getInventoryLevel() left!</div>


Exposing Discount Levels

As with inventory, we can expose a products discount % at a campaign level using a similar approach and the below variable:


The below campaign looks at the currently viewed product, grabs the discount % and #if the discount % is greater than or equal to 9 it will output the campaign.

#if ($!context.getViewedProduct().getDiscount().percent >= 9) 

<div id="discount" class="nosto-fomo" style="border: 2px dashed black;">$!context.getViewedProduct().getDiscount().percent% off for a limited time only.</div>

Did this answer your question?