Most partners use the auto-setup approach because it is the fastest path to production. This guide covers the full data-attribute setup and all supported combinations.
1) Main script tag
The main SDK auto-initializes when it finds a script tag with data-liquid-commerce-elements.
Hosted checkout needs two things working together:
A checkout URL so the cart can redirect to your hosted checkout page.
A checkout param name so the hosted page can read the checkout ID from the URL and load it.
Checkout container
Attribute:data-lce-checkout
Injects the hosted checkout into this container on the checkout page.
Hide checkout header
Attribute:hide-header
Hides the SDK header so you can render your own header and layout.
Exit checkout button
Attribute:data-lce-exit-checkout
Lets you build your own βExit checkoutβ UI. The SDK wires the click to the checkout exit action.
Checkout ID from query params (required for hosted checkout)
Use data-checkout-param on the script tag to control which query param provides the checkout ID. Attribute:data-checkout-param
Sets the query parameter name (must start with lce_). The hosted page reads this param to load the checkout.
Notes:
Query parameter names must start with lce_ or they are ignored.
Default is lce_checkout if not provided.
Checkout redirect URL (required for hosted checkout)
Attribute:data-checkout-url
Defines the hosted checkout page URL pattern. The cart drawer redirects to this URL and injects the checkout token into {token}.
Checkout-only auto-initialize
Use the checkout-only build when you only need checkout on the hosted checkout page. It supports the same hosted-checkout attributes (data-lce-checkout, data-checkout-param, hide-header, data-lce-exit-checkout) but ships a smaller script for faster load time.
Supported attributes on checkout-only script:
data-token (required)
data-env (optional)
data-debug-mode (optional, non-production only)
data-checkout-url (optional)
The checkout-only build also supports data-lce-checkout containers and data-checkout-param query parameter handling.
5) Auto actions from query parameters
Auto-init can read query params to add a product or apply a promo code.
Add product to cart via query params
data-product-param (required)
data-product-fulfillment-type-param (optional, shipping or onDemand)
Attribute:data-product-param
Name of query param that contains the product identifier (must start with lce_).
Attribute:data-product-fulfillment-type-param
Name of query param that contains fulfillment type (must start with lce_).
Example URL:
Apply promo code via query params
data-promo-code-param
Attribute:data-promo-code-param
Name of query param that contains the promo code (must start with lce_).
Example URL:
Notes:
Query parameter names must start with lce_ or they are ignored.
6) Advanced script options (optional)
These are supported but not required for most implementations.
Promo ticker
All four of these must be present to enable the promo ticker.
Attributes:data-promo-code, data-promo-text, data-promo-separator, data-promo-active-from, data-promo-active-until
Enables the promo ticker. data-promo-text is pipe-separated (e.g. "Text A|Text B").
Development config
For local development or testing, you can inject development overrides via a JSON script tag:
Attribute:data-liquid-commerce-elements-development
Reads JSON for development overrides.