How variables work

Variables are placeholders you insert into your message templates. They look like {{variable_name}}. When a message is displayed to a shopper, ProofNudge replaces each variable with the real, current value from your store data.

For example, the template {{viewer_count_current}} people viewing this right now might render as "24 people viewing this right now" on one product and "3 people viewing this right now" on another.

Variables resolve to real numbers only. ProofNudge never simulates, inflates, or fakes any values. If a product has had zero orders this week, {{order_count_pastweek}} resolves to "0."

Viewer & view count variables

These track how many people are viewing or have viewed a product page. See the real-time visitor count feature page for details on how viewer counting works.

Real-time viewers

  • {{viewer_count_current}} — Number of unique visitors on this product page right now (within the last 5 minutes). Updates in real time.
Note: viewer_count_current counts unique visitors within a 5-minute rolling window. A single visitor refreshing the page multiple times still counts as one viewer.

Historical view counts

  • {{view_count_past24h}} — Total page views in the last 24 hours.
  • {{view_count_pastweek}} — Total page views in the last 7 days.
  • {{view_count_pastmonth}} — Total page views in the last 30 days.
  • {{view_count_pastyear}} — Total page views in the last 365 days.

Historical viewer counts (unique)

  • {{viewer_count_past24h}} — Unique visitors in the last 24 hours.
  • {{viewer_count_pastweek}} — Unique visitors in the last 7 days.
  • {{viewer_count_pastmonth}} — Unique visitors in the last 30 days.
  • {{viewer_count_pastyear}} — Unique visitors in the last 365 days.

Cart count variables

These track how many times a product has been added to a cart.

  • {{cart_count_past24h}} — Cart additions in the last 24 hours.
  • {{cart_count_pastweek}} — Cart additions in the last 7 days.
  • {{cart_count_pastmonth}} — Cart additions in the last 30 days.
  • {{cart_count_pastyear}} — Cart additions in the last 365 days.

Order & purchase variables

These track completed purchases for a product.

  • {{order_count_past24h}} — Orders in the last 24 hours.
  • {{order_count_pastweek}} — Orders in the last 7 days.
  • {{order_count_pastmonth}} — Orders in the last 30 days.
  • {{order_count_pastyear}} — Orders in the last 365 days.

Revenue variables

Revenue generated by a specific product over various time periods.

  • {{revenue_past24h}} — Revenue in the last 24 hours.
  • {{revenue_pastweek}} — Revenue in the last 7 days.
  • {{revenue_pastmonth}} — Revenue in the last 30 days.
  • {{revenue_pastyear}} — Revenue in the last 365 days.

Ranking variables

Auto-calculated rankings based on sales data. These tell shoppers where a product ranks within its type or collection. Learn more about best seller badges and ranking messages.

Product type rankings

  • {{product_type_sales_rank}} — Sales rank within the product's type (e.g., "#2 in Dresses").
  • {{product_type_views_rank}} — View count rank within the product's type.

Collection rankings

  • {{product_collection_sales_rank:handle}} — Sales rank within a specific collection. Replace handle with the collection's handle (e.g., best-sellers).
  • {{product_collection_views_rank:handle}} — View count rank within a specific collection.
  • {{product_collection_cart_rank:handle}} — Cart activity rank within a specific collection.
Tip: Rankings update automatically as new sales data comes in. A product ranked #5 today might be #2 tomorrow if it starts selling faster than competitors in the same collection.

Product context variables

These are read directly from the Shopify product data on the current page. They don't require any event tracking.

  • {{product_title}} — The product's title.
  • {{product_type}} — The product's type (e.g., "Dresses," "Serums").
  • {{product_vendor}} — The product's vendor/brand.
  • {{product_price}} — The product's current price, formatted.
  • {{compare_at_price}} — The product's compare-at price (original/MSRP).
  • {{stock_left}} — Current inventory quantity for the selected variant.
  • {{discount_amount}} — The discount in dollars (compare_at_price minus price).
  • {{discount_percentage}} — The discount as a percentage off compare_at_price.

Shipping & cart variables

These relate to the current shopper's cart and shipping thresholds configured in your ProofNudge settings.

  • {{shipping_amount_away}} — How much more the shopper needs to spend for free shipping.
  • {{shipping_threshold}} — Your free shipping threshold amount.

Gift with purchase variables

  • {{gift_product_title}} — Title of the free gift product.
  • {{gift_amount_away}} — How much more the shopper needs to spend to qualify for the gift.
  • {{gift_threshold}} — The spending threshold for the gift.

Collection-scoped variables

These provide view and viewer counts scoped to a specific collection, rather than a single product.

  • {{collection_view_count_past24h:handle}} — Total views across all products in a collection (24h).
  • {{collection_view_count_pastweek:handle}} — Total views across a collection (7 days).
  • {{collection_viewer_count_past24h:handle}} — Unique viewers across a collection (24h).
  • {{collection_viewer_count_pastweek:handle}} — Unique viewers across a collection (7 days).
Collection handles: Replace :handle with the URL-safe handle of your collection. For example, if your collection URL is /collections/best-sellers, the handle is best-sellers. You can find handles in Shopify Admin under Collections.

Product type-scoped variables

Aggregate metrics across all products of the same type.

  • {{type_order_count_pastweek}} — Total orders for all products of this type (7 days).
  • {{type_order_count_pastmonth}} — Total orders for all products of this type (30 days).
  • {{type_view_count_pastweek}} — Total views for all products of this type (7 days).
  • {{type_view_count_pastmonth}} — Total views for all products of this type (30 days).

Discount code variables

  • {{discount_code}} — A discount code configured in your campaign settings.
  • {{discount_code_value}} — The value of the configured discount code.

Using variables in messages

Wrap any variable name in double curly braces: {{variable_name}}. You can combine multiple variables in a single message:

{{viewer_count_current}} people viewing · Bought {{order_count_pastweek}} times this week

This would render as something like: "24 people viewing · Bought 47 times this week."

Best practices

  • Use conditions: Always pair variables with conditional display rules to avoid showing "0" counts. For example, only show the order count message when order_count_pastweek > 5.
  • Choose the right time window: New stores should use longer windows (pastmonth) to accumulate meaningful numbers. Established stores can use shorter windows (past24h, pastweek) for fresher data.
  • Don't overwhelm: Show 1-3 messages per product page, not 10. Pick the most relevant proof for your product category.
  • Test different variables: Try viewer counts vs. purchase counts vs. rankings. Different products respond to different types of proof.