Specific integration instructions to enable order extraction.
Sleek’s SDK can extract order details from pages your users are visiting. This feature allows you to capture successful transactions and order details. This documentation will guide you through the integration process.
This document assumes that you have already integrated the Sleek SDK. If you haven’t, please refer to the SDK integration guide.
Sleek will only return order information on pages that are classified as
cart, checkout or checkoutComplete. To determine the page classification,
you can use the classifyPage method. See the page classification
guide for more information.
Alternatively, you can receive order information automatically by subscribing to the ORDER_EXTRACTED event.
This requires to set emitPageClassification to true in the SDK’s options during initialization.
Copy
<script src="f.js"></script><script src="sdk.iife.js"></script><script> sleek.initializeSdk("YOUR_PUBLIC_API_KEY_HERE", { featureControls: { emitOrders: true, }, }, [ (event) => { // `event` is typed, so is the data of the event `event.data` based on the type of the event. switch (event.type) { case SdkEventType.ORDER_EXTRACTED: const order = event.data.order; const classification = event.data.pageClassification; break; } } ]);</script>