selector.viewed

Once a page, when half of the selector is on screen, with the option it picked: from ?forceBundleId, the cart, data-next-selected, else its first option.

CODE
next.on('selector.viewed', (data, event) => {});

Data

Present: always; optional when it may be missing; campaign once the campaign is loaded; priced once the server priced the cart.

FieldTypePresent
pricenumberpricedtotal ÷ quantity: one package, after discounts.
original_pricenumberpricedsubtotal ÷ quantity: one package, before discounts.
subtotalnumberpricedWhat it costs before discounts.
total_discountnumberpricedsubtotal − total.
discount_percentagenumberpricedtotal_discount ÷ subtotal × 100, to two decimals.
selector_idstringalwaysdata-next-selector-id, or toggle:<package_id> for a toggle.
type"bundle" | "offer" | "toggle"always
option_idstringoptionalThe picked option's data-next-bundle-id; none for a toggle.
linesCartItem[]alwaysThe lines the picked option puts in the cart, at its quantity; the toggle's line for a toggle. Priced once the option has a price.
currencystringcampaignISO 4217, such as USD.
totalnumberpricedWhat the picked option costs after discounts.
quantitynumberalwaysPackages the picked option adds.
in_cartbooleanalwaystrue while the picked option's lines are in the cart.
optionsSelectorOption[]optionalEvery option of a bundle or offer selector; none for a toggle.

CartItem

A line of the cart. Its prices are there once the server priced the cart.

FieldTypePresent
package_idnumberalwaysThe package's ref_id in the campaign.
quantitynumberalwaysPackage quantity.
is_upsellbooleanoptionaltrue for a line added after the order.
propertiesRecord<string, string>optionalLine properties, such as a variant picked in a bundle slot.
product_idnumbercampaignThe product in the store.
product_titlestringcampaignThe product's name as customers see it, as on an order line; the package's name for a package without one.
variant_idnumbercampaignThe product variant, for a product with variants.
variant_titlestringcampaignThe variant's name, such as Black / M, for a product with variants.
skustringcampaignThe product's Stock Keeping Unit.
imagestringcampaignThe package's image URL.
pricenumberpricedWhat one package costs after discounts.
original_pricenumberpricedWhat one package costs before discounts; equal to price when nothing is taken off.
total_discountnumberpricedThe discount on the line.
totalnumberpricedprice × quantity.
subtotalnumberpricedThe line before discounts: total = subtotal − total_discount.
discount_percentagenumberpricedtotal_discount ÷ subtotal × 100, to two decimals; 0 without a discount.
discountsDiscount[]pricedThe discounts on the line.
subscriptionSubscriptioncampaignFor a package billed again every interval.

SelectorOption

One option of a selector, at the quantity it would be added.

FieldTypePresent
pricenumberpricedtotal ÷ quantity: one package, after discounts.
original_pricenumberpricedsubtotal ÷ quantity: one package, before discounts.
subtotalnumberpricedWhat it costs before discounts.
total_discountnumberpricedsubtotal − total.
discount_percentagenumberpricedtotal_discount ÷ subtotal × 100, to two decimals.
option_idstringalwaysThe option's data-next-bundle-id, or data-next-option.
linesCartItem[]alwaysThe lines the option puts in the cart. Priced once the option has a price.
quantitynumberalwaysPackages the option adds: its lines' quantities.
selectedbooleanalwaystrue for the selector's picked option.
totalnumberpricedWhat the option costs after discounts.
original_totalnumberpricedWhat the option costs before discounts.

Discount

A discount on the cart's products or on its shipping. Amounts are in the cart's currency.

FieldTypePresent
namestringalwaysThe offer's name.
amountnumberalwaysThe amount taken off.
source"offer" | "coupon"alwayscoupon for a code the shopper entered (it is in coupons); offer for an automatic offer or a bundle card's own code.
codestringoptionalThe code, for a coupon.
offer_idnumberalwaysThe offer that gave it.
percentagenumberoptionalThe percentage the offer is set to take off, as the API reports it, such as 20. Its configured value, for a label such as “20% off”; the amount actually taken off is amount.

Subscription

A package billed again every interval.

FieldTypePresent
interval"day" | "month"alwaysThe unit of the renewal interval.
interval_countnumberalwaysHow many intervals between renewals.
pricenumberpricedWhat each renewal charges, after discounts.
original_pricenumberpricedWhat each renewal charges before discounts.

Example

The second argument, with data inside. See Events for the envelope's fields.

CODE
{
  "event_id": "3f2b8c1d9e7a4b6c8d5e2f1a0b9c8d7e",
  "event_type": "selector.viewed",
  "object": "selector",
  "data": {
    "selector_id": "main",
    "type": "bundle",
    "option_id": "one",
    "lines": [
      {
        "package_id": 1,
        "quantity": 1,
        "product_id": 400,
        "product_title": "Olympus Earbuds",
        "variant_id": 4001,
        "variant_title": "Black",
        "image": "https://cdn.test/1.png"
      }
    ],
    "currency": "USD",
    "quantity": 1,
    "in_cart": false,
    "options": [
      {
        "option_id": "one",
        "lines": [
          {
            "package_id": 1,
            "quantity": 1,
            "product_id": 400,
            "product_title": "Olympus Earbuds",
            "variant_id": 4001,
            "variant_title": "Black",
            "image": "https://cdn.test/1.png"
          }
        ],
        "quantity": 1,
        "selected": true
      },
      {
        "option_id": "two",
        "lines": [
          {
            "package_id": 2,
            "quantity": 1,
            "product_id": 400,
            "product_title": "Olympus Earbuds",
            "variant_id": 4002,
            "variant_title": "Black",
            "image": "https://cdn.test/2.png"
          }
        ],
        "quantity": 1,
        "selected": false
      }
    ]
  },
  "created_at": "2026-11-04T08:30:00.000Z",
  "session_id": "0b8f3c2d1e4a4f6b9c7d5e3f2a1b0c9d",
  "sdk_version": "0.5.0"
}