How FairShare works
FairShare runs in the browser. On every page load, and on every client-side navigation, it sends the page URL to Fluid. When the URL names a member, that visit establishes the member’s credit. FairShare then carries the credit with the visitor, into the cart, lead capture, and media. See How credit is established and kept.Installation
On a Fluid storefront, FairShare is already installed: Fluid loads it through a global embed when the company is created. Don’t add it again. See FairShare SDK and the storefront. On any other website, add this tag to the<head>:
data-fluid-shopis your company’s Fluid subdomain —acmeforacme.fluid.app.type="module"is required. The script is an ES module and fails to load without it.
How a rep is resolved
Fluid resolves a rep from the page URL, checking in this order:- A
usernameorreferralquery parameter. - A rep’s own subdomain.
- The first segment of the path. On a Fluid storefront this is the credit segment.
/jordan-lee/products/beet-blendcreditsjordan-lee, and/home/...names no rep. See Supported paths.
window.FairShareSDK.getAttribution() returns the result for the current page’s URL, so it returns null on such a page even for a visitor a member already credited.
Overrides
Attributes on the script tag override the URL. Use one when a page should always credit the same rep, or when your own site already knows who the rep is:
FairShare uses the first attribute present, in this order:
data-fluid-rep-id, data-email, data-username, data-external-id. It doesn’t check that the rep exists, so an unknown value doesn’t fall through to the next attribute.
The browser remembers an override. Removing the attribute doesn’t clear it for someone who has already visited — clear the site’s data to test URL-based attribution again.
data-share-guid is the older name for data-username: Fluid matches its value against rep usernames. It is still accepted, and it takes precedence over every other override. Use data-username in new code.How credit is established and kept
A member, or rep, earns credit for a visitor in two steps: a credit path establishes the credit, and FairShare keeps it.- A credit path establishes credit. A member’s credit path names them in the URL, for example
/jordan-lee/products/beet-blend. When a visitor lands on one and FairShare logs the visit, that member gets credit for the visitor. - The member keeps the credit. FairShare’s tracking uses cookies, a browser fingerprint, and similar signals. It carries the credit across later pages and visits in the same browser, including across domains. Credit doesn’t follow the shopper to a different browser or device.
- Pages without a credit path don’t change it.
/home/...pages, custom routes, and marketing URLs that redirect, such as/tv-offer, establish no new credit. They don’t take away credit a visitor already has. - A visitor who never lands on a credit path has no rep. For example, a visitor who arrives on
/tv-offerwith no FairShare credit, and buys from/home/...pages, places an order with no rep. - Another member’s link is a second touch. When a credited visitor later lands on a different member’s credit path, the Shared links (multi-rep) setting decides which member earns commission: first touch, last touch, or most activity. See Fair Share settings.
What members and marketers share
- Members share credit paths. A member shares links that carry their username, from the Fluid mobile app or their own links.
- Marketing and legacy URLs are for customers without a rep. A URL such as
/tv-offerserves orphaned customers, who arrive without a member. Don’t add?username=to it.
From visit to order
- The SDK creates the cart on the first add to cart. The order inherits the cart’s rep.
- A cart started on a credit path takes that page’s member. Adding more items doesn’t change the rep.
- A cart started on a page without a credit path keeps the visitor’s credit. A visitor a member already credited keeps that member’s credit. A visitor with no FairShare credit gets a cart with no rep.
- Lead capture credits the rep attributed on the page where the form is submitted.
- Video views from the media widget are credited to the page’s rep.
Across domains
Credit carries across domains. A shopper credited on one domain keeps that member’s credit on the company’s other domains, such as its custom domain and itsfluid.app subdomain, and at checkout.
Credit stays with the browser. A shopper who opens the store in another browser or on another device doesn’t carry the credit there.
The cart is different: each domain keeps its own cart, and the cart reaches checkout through its token in the checkout URL.
What FairShare adds to the page
- Cart widget — a slide-out cart that lets shoppers add products and go to checkout. See Cart API.
- Lead capture widget — a form that saves a visitor’s contact details as a lead for the attributed rep.
- Media widget — plays Fluid-hosted videos, images, and playlists, with a call to action. See Media.
- Real-time cart updates: live cart syncing, so a cart changed in another tab or by the server updates without a page refresh. Fluid storefront loaders always turn it on. On a hand-installed SDK, set
data-realtime-enabled="true".
Next steps
- Installation — every script-tag option.
- FairShare SDK and the storefront — credit paths, add to cart, and media on a Fluid storefront.
- Server-side attribution migration — remove retired attribution attributes.
- Fair Share settings — choose in the admin which rep earns commission on shared links, re-orders, orphaned orders and enrollment orders.