Building a Fluid theme? Your storefront already loads the SDK from a Global Embed that Fluid manages, so don’t add the script tag to your theme. See Common theme pitfalls. Add the script yourself only on sites Fluid doesn’t host.
Key Capabilities
Attribution Tracking
Supply usernames, rep IDs, email addresses, or external identifiers and inspect the attribution that FairShare resolves for each page.
Cart Management
Add and remove products, adjust quantities, apply subscription plans, and send shoppers to checkout, all through a simple JavaScript API or declarative HTML attributes. A pre-built cart widget UI is included. Carts fill in the background, so see how cart calls resolve.
Lead Capture
Collect prospect information with a customizable form widget that slots into any page layout. Submit leads programmatically or let the widget handle the UI entirely.
Media
Embed product videos and media libraries as inline players or popover overlays. Fetch media metadata via JavaScript to build fully custom playback experiences.
Analytics
Fire custom events against the Fluid attribution pipeline, inspect the active attribution record, and retrieve session tokens for cross-system correlation.
How Attribution Works
On every page, FairShare resolves attribution from the page URL — on a Fluid storefront, the rep’s username in the path. The script-tag attributes below override that. FairShare uses the first attribute present, in this order, and doesn’t check that the rep exists. See FairShare SDK and the storefront.
Read the result for the current page with
window.FairShareSDK.getAttribution().
A page whose URL names no rep establishes no new credit. It doesn’t remove credit
the visitor already has. See
How credit is established and kept.
Add the script tag
FairShare loads from one script tag. Add it to every page where you want it to run, and replaceyour-shop-id with your company’s Fluid subdomain (acme for acme.fluid.app):
type="module" and id="fluid-cdn-script" on the tag. In the admin, Settings › Developer shows the snippet with your subdomain filled in. Fluid-hosted storefronts already load the SDK, so don’t add the tag to a Fluid theme. For every option, see Installation.
Framework Support
FairShare works with any website — static HTML, server-rendered pages, or JavaScript-heavy single-page apps. Because it loads as a plain<script> tag, you do not need a build system, a package manager, or a specific frontend framework.
Next Steps
Installation
Add the script tag and configure attribution for your site.
Cart API
Explore the full JavaScript cart API and declarative HTML controls.
Components
Browse the cart, lead capture, and media web components.
Media
Listen for playback events and configure media calls to action.