The track Function
Last updated: March 31, 2026
The Noibu JavaScript SDK includes a track() function for sending key ecommerce events (e.g. add to cart, checkout, purchase) to Noibu. Event data is captured in session replays, giving your team additional context into shopper behaviour during issue investigation.
For Shopify and BigCommerce deployments, ecommerce event collection is enabled automatically. For all other platforms, use the track() function to implement it manually.
Basic structure
window.NOIBUJS.track(eventType, eventData);Because the Noibu JS SDK is attached to the global window as window.NOIBUJS, make sure it’s available before calling track() (or wait for the noibuSDKReady event).
Parameters
eventType: string (required)
One of the following supported event types:
product_added_to_cart— logged when a customer adds a product to their cartproduct_removed_from_cart— logged when a customer removes a product from their cartcheckout_started— logged when a customer begins the checkout processpayment_info_submitted— logged when a customer submits their payment informationcheckout_completed— logged when a customer completes a purchasesearch_submitted— logged when a customer performs a search on the storefrontcollection_viewed— logged when a customer visits a product collection index pageproduct_viewed— logged when a customer visits a product details pagecart_viewed— logged when a customer visits the cart page
These event names match Shopify’s standard Web Pixels event names. (Shopify)
eventData: object (required)
An object whose shape matches the payload of the corresponding Shopify Web Pixels “standard event” for the given eventType. All fields are optional (you can send partial payloads). (Shopify)
Return value
track() returns:
{ success: boolean, errors: string[] }success:truewhen the event is accepted for tracking; otherwisefalseerrors: a list of validation errors (empty whensuccessistrue)
Examples
Wait for SDK readiness (recommended)
async function trackCheckoutStarted() {
if (!window.NOIBUJS) {
await new Promise((resolve) => window.addEventListener("noibuSDKReady", resolve));
}
const result = window.NOIBUJS.track("checkout_started", {
// Shopify-standard payload shape; all fields optional
checkout: {
token: "example-checkout-token",
totalPrice: { amount: 49.99, currencyCode: "USD" },
},
});
if (!result.success) console.warn("Noibu track failed:", result.errors);
}