- load the widget script on every page, including the cart and order confirmation pages
- wrap every call below in this helper, so it waits until the widget has loaded:
Logged-in customer
CalllinkCustomer on every page load while a customer is logged in. Send only your internal customer id, never an email, phone number or name.
Molin.reset().
Cart
CallsetCart on every page load and after every cart change. Always send the whole cart, and lines: [] once it is empty.
Purchase
CalltrackPurchase on the order confirmation page, once the order is confirmed. Reloading the page is safe, each orderId counts once.
Line items
Each entry inlines is one product. Identify it with at least one of url, sku, gtin or variantId, matching your product feed character for character.
Field rules
Field rules
A call that breaks these rules is rejected. Send ids as strings, for example
String(id), not as numbers. An empty sku, gtin or variantId is ignored.Checking that it works
Filter the browser’s DevTools console byMolin: storefront events error. No errors means the calls work. An error names the call and the field to fix, for example setCart was not sent with lines.0.price.