Events

The SDK emits browser events for user actions and state changes. Listen on window using lce:actions.* and lce:forms.*.

Event shape

All SDK events are native CustomEvent objects. The payload lives in event.detail:

export interface IEventMetadata {
  eventId: string;
  namespace: 'actions' | 'forms';
  event: string;
  originalEvent: string;
  actionNamespace?: 'address' | 'product' | 'cart' | 'checkout' | 'other';
  timestamp: number;
}

export interface IEnhancedEventData<T> {
  data: T;
  metadata: IEventMetadata;
}
window.addEventListener('lce:actions.event_name', (event) => {
  const { data, metadata } = event.detail;
});

TypeScript interfaces: The interface names used below match the SDK type definitions.

Namespaces

  • lce:actions.* - User actions and state changes

  • lce:forms.* - Form field interactions (checkout)

  • lce:actions - All action events (namespace listener)

  • lce:forms - All form events (namespace listener)

Example: listen to every action event:

Client lifecycle

lce:actions.client_ready

Fired once when the SDK is initialized and safe to use.

Data shape (TypeScript)

Example

Product events

lce:actions.product_loaded

Product data finished loading into a product component.

Data shape (TypeScript)

Example

lce:actions.product_add_to_cart

User triggered add-to-cart from a product component. Use cart events to confirm success or failure.

Data shape (TypeScript)

Example

lce:actions.product_size_changed

User changed the selected size.

Data shape (TypeScript)

Example

lce:actions.product_fulfillment_type_changed

User switched fulfillment type (for example shipping vs onDemand).

Data shape (TypeScript)

Example

lce:actions.product_fulfillment_changed

User selected a different fulfillment option or retailer.

Data shape (TypeScript)

Example

lce:actions.product_quantity_increase

Product quantity increased.

Data shape (TypeScript)

Example

lce:actions.product_quantity_decrease

Product quantity decreased.

Data shape (TypeScript)

Example

Address events

lce:actions.address_updated

Address successfully set or changed.

Data shape (TypeScript)

Example

lce:actions.address_cleared

Address removed.

Data shape (TypeScript)

Example

lce:actions.address_failed

Address set failed (validation, geocode, etc.).

Data shape (TypeScript)

Example

Cart events

lce:actions.cart_loaded

Cart state loaded or synced.

Data shape (TypeScript)

Example

lce:actions.cart_opened

Cart drawer opened.

Data shape (TypeScript)

Example

lce:actions.cart_closed

Cart drawer closed.

Data shape (TypeScript)

Example

lce:actions.cart_updated

Cart totals/items changed.

Data shape (TypeScript)

Example

lce:actions.cart_reset

Cart cleared.

Data shape (TypeScript)

Example

lce:actions.cart_failed

Cart operation failed.

Data shape (TypeScript)

Example

lce:actions.cart_item_added

Item added to cart.

Data shape (TypeScript)

Example

lce:actions.cart_item_removed

Item removed from cart.

Data shape (TypeScript)

Example

lce:actions.cart_item_quantity_increase

Cart item quantity increased.

Data shape (TypeScript)

Example

lce:actions.cart_item_quantity_decrease

Cart item quantity decreased.

Data shape (TypeScript)

Example

lce:actions.cart_item_engraving_updated

Engraving text updated for a cart item.

Data shape (TypeScript)

Example

lce:actions.cart_promo_code_applied

Promo code applied to cart.

Data shape (TypeScript)

Example

lce:actions.cart_promo_code_removed

Promo code removed from cart.

Data shape (TypeScript)

Example

lce:actions.cart_promo_code_failed

Promo code failed validation.

Data shape (TypeScript)

Example

lce:actions.cart_product_add_success

Programmatic add-to-cart succeeded.

Data shape (TypeScript)

Example

lce:actions.cart_product_add_failed

Programmatic add-to-cart failed.

Data shape (TypeScript)

Example

Checkout events

lce:actions.checkout_loaded

Checkout state loaded.

Data shape (TypeScript)

Example

lce:actions.checkout_opened

Checkout drawer opened.

Data shape (TypeScript)

Example

lce:actions.checkout_closed

Checkout drawer closed.

Data shape (TypeScript)

Example

lce:actions.checkout_failed

Checkout failed to load or operate.

Data shape (TypeScript)

Example

lce:actions.checkout_customer_information_updated

Customer info updated.

Data shape (TypeScript)

Example

lce:actions.checkout_billing_information_updated

Billing info updated.

Data shape (TypeScript)

Example

lce:actions.checkout_gift_information_updated

Gift recipient info updated.

Data shape (TypeScript)

Example

lce:actions.checkout_is_gift_toggled

Gift mode toggled.

Data shape (TypeScript)

Example

lce:actions.checkout_billing_same_as_shipping_toggled

Billing same-as-shipping toggled.

Data shape (TypeScript)

Example

lce:actions.checkout_marketing_preferences_toggled

Marketing preference toggled.

Data shape (TypeScript)

Example

lce:actions.checkout_item_removed

Item removed during checkout.

Data shape (TypeScript)

Example

lce:actions.checkout_item_quantity_increase

Checkout item quantity increased.

Data shape (TypeScript)

Example

lce:actions.checkout_item_quantity_decrease

Checkout item quantity decreased.

Data shape (TypeScript)

Example

lce:actions.checkout_item_engraving_updated

Engraving text updated for a checkout item.

Data shape (TypeScript)

Example

lce:actions.checkout_tip_updated

Delivery tips updated.

Data shape (TypeScript)

Example

lce:actions.checkout_submit_started

Checkout submit started.

Data shape (TypeScript)

Example

lce:actions.checkout_submit_completed

Checkout completed successfully.

Data shape (TypeScript)

Example

lce:actions.checkout_submit_failed

Checkout submission failed.

Data shape (TypeScript)

Example

lce:actions.checkout_promo_code_applied

Promo code applied in checkout.

Data shape (TypeScript)

Example

lce:actions.checkout_promo_code_removed

Promo code removed in checkout.

Data shape (TypeScript)

Example

lce:actions.checkout_promo_code_failed

Promo code failed in checkout.

Data shape (TypeScript)

Example

lce:actions.checkout_gift_card_applied

Gift card applied in checkout.

Data shape (TypeScript)

Example

lce:actions.checkout_gift_card_removed

Gift card removed in checkout.

Data shape (TypeScript)

Example

lce:actions.checkout_gift_card_failed

Gift card failed in checkout.

Data shape (TypeScript)

Example

lce:actions.checkout_product_add_success

Programmatic add-to-checkout succeeded.

Data shape (TypeScript)

Example

lce:actions.checkout_product_add_failed

Programmatic add-to-checkout failed.

Data shape (TypeScript)

Example

Form events

lce:forms.customer

Fires when a customer form field changes in checkout.

Data shape (TypeScript)

Example

lce:forms.billing

Fires when a billing form field changes in checkout.

Data shape (TypeScript)

Example

lce:forms.gift

Fires when a gift form field changes in checkout.

Data shape (TypeScript)

Example

Analytics example

Last updated