Skip to main content
Shopify, Shoprenter, UNAS and Shoper shops: skip this page, the widget collects this data for you, and Help Molin learn what your shoppers buy lists what to do on each platform. Everyone else needs two things first:
  • 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

Call linkCustomer on every page load while a customer is logged in. Send only your internal customer id, never an email, phone number or name.
When the customer logs out, call Molin.reset().

Cart

Call setCart on every page load and after every cart change. Always send the whole cart, and lines: [] once it is empty.

Purchase

Call trackPurchase on the order confirmation page, once the order is confirmed. Reloading the page is safe, each orderId counts once.

Line items

Each entry in lines is one product. Identify it with at least one of url, sku, gtin or variantId, matching your product feed character for character.
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 by Molin: 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.