Skip to content

Leer en español

Developer guide

Fik Satellites puts an online store's products on any website: product grids, carousels, single products and buy buttons, with a cart and the store's own checkout. This page is for whoever builds or maintains the website. The store owner creates the widgets and sends you the code to paste: you don't need an account anywhere.

Your snippet

The store owner sends you a snippet like this one, ready to paste. Its comments number the parts:

<!-- Product widgets. Developer guide: https://app.fiksatellites.com/docs -->

<!-- 1. Once per page, in the site's header or footer (skip if it's already there) -->
<script src="https://cdn.fiksatellites.com/v1/fik-satellites.js" defer data-shop="example-store" data-site="example-website"></script>

<!-- 2. Optional: the cart icon, e.g. in the header menu. Without it, a floating cart
     button appears once something is in the cart. To use it, move this line out of the comment:
     <div data-fsat-widget="cart"></div>
-->

<!-- 3. Where these products should appear -->
<div data-fsat-widget data-id="home-new-releases"></div>
  1. The script goes once on every page that shows widgets, ideally in the site-wide header or footer. It's the same line in every snippet for this website, so if it's already on the page, skip it.
  2. The cart icon is optional. Put the <div data-fsat-widget="cart"></div> line where the icon should sit, usually the site-wide header, outside the comment. Without it, a floating cart button appears in the bottom-right corner once something is in the cart.
  3. The widget goes exactly where the products should appear. Paste it as it is: its data-id names a widget the store owner saved, which says which products to show and in which layout, and names this placement for the store's sales reports. When the store owner changes the widget, this website follows within about 5 minutes, with no new code.

Everything else (colors, corners, font, language, market) comes from the store owner's widget settings, so they can change it later without touching the website.

Widgets never break the page. If something is misconfigured or a service is down, they stay invisible and log a [fsat] warning to the browser console. See Troubleshooting.

Where to paste it

The cart and widget lines are plain divs, which most editors keep intact. The script needs a place that allows scripts: usually a site-wide header or footer setting, otherwise an HTML block on the same page.

Platform1. Script (once per site)2–3. Cart icon and widgets
WordPressIn the theme's header or footer, or with a plugin such as WPCode (“Header & Footer”). Block themes: Site Editor → a Custom HTML block in the header template part.Block editor: a “Custom HTML” block. Classic editor: the “Text” tab. Elementor: the “HTML” widget. Divi and WPBakery: their “Code” module.
JoomlaA “Custom” module in a header or footer position, with the editor set to “None”. If the script gets stripped, allow it in Global Configuration → Text Filters for that user group.A “Custom” module, or an article with the editor set to “None”.
DrupalThe theme's html.html.twig or a library, or a module such as Asset Injector.The body field with the “Full HTML” text format (or any format that allows div with data- attributes).
WebflowSite settings → Custom code → Footer code (needs a paid site plan).A “Code Embed” element.
SquarespaceCode Injection → Footer (Core plan or higher). Newer accounts: Website → Website Tools → Code Injection; older ones: Settings → Advanced.A “Code” block, set to HTML.
WixSettings → Custom code → add to all pages, at Body end (needs a premium plan with a connected domain).Limited: Wix puts “Embed HTML” elements in an isolated frame, so a widget there can't use the page's cart. Put the script and the widget in the same embed; that widget then has its own cart and checkout button inside the frame.
GhostSettings → Code injection → Site footer.An “HTML” card.
HubSpot CMSSettings → Content → Pages → Templates → Site footer HTML.A “Custom HTML” module, or the rich text editor's source code view.
Custom site (React, Vue, Next.js, static HTML…)Load the script once, e.g. in the root layout or page template, with defer (Next.js: strategy “afterInteractive”).Render the widget div as it is (in JSX, without the HTML comments). Widgets added later, by client-side routing or AJAX, are picked up automatically. See “React and other frameworks” below.

Caching and optimisation plugins (WP Rocket, Autoptimize, LiteSpeed, Cloudflare Rocket Loader…) sometimes combine or delay scripts. If widgets don't appear, exclude /v1/fik-satellites.js from combining and delaying, or add data-cfasync="false" to the script tag for Rocket Loader.

React and other frameworks

  • Load the script from the HTML document or the root layout, not from a component: script tags rendered by React don't run. With server rendering, load it after hydration (Next.js: <Script strategy="afterInteractive">), otherwise the widgets change their placeholder before React hydrates and React reports a mismatch.
  • In JSX, drop the HTML comments and render the widget div as it is. Placeholders added later (client-side routing, AJAX) are picked up automatically.
  • A placeholder mounts once. If a route reuses the same div for a different snippet, give it a React key so a new one is created.
  • Placeholders inside your own Shadow DOM aren't seen automatically: call FikSatellites.mount(shadowRoot).

More widgets

Each widget is created by the store owner, with a live preview: a product grid, a carousel, a swipeable row, a single product or just a buy button. To change a widget's products, layout or heading, the store owner edits it and the website follows: the snippet stays the same. For a widget in another spot, ask whoever gave you the code for a new snippet: each placement gets its own, so the store can see which ones sell. Several widgets can share a page; the script still goes on once.

Widgets adapt to the space they're given, not to the screen: when a widget is 600px wide or less (a phone, or a narrow column on a desktop page) it uses its mobile layout, which the store owner chooses. To try it, resize the widget's container, not the browser window.

What's in a snippet

A snippet only needs data-fsat-widget and data-id. Every setting below can also be added to the placeholder, and then it overrides the saved setting for that placement only; everything you don't set still comes from the store owner. Use this sparingly: the store owner can't see or change what you set here.

<!-- The saved widget, as the store owner set it up -->
<div data-fsat-widget data-id="home-new-releases"></div>

<!-- The same widget, with a list on phones and 3 columns on this page -->
<div data-fsat-widget data-id="home-new-releases" data-mobile-layout="list" data-columns="3"></div>
AttributeMeaning
data-fsat-widgetMarks a widget; empty in snippets. A layout here (grid, scroller, carousel, product, button) shows the saved widget in that layout instead. cart is the cart icon.
data-idThe saved widget's ID. It also names this placement in the store's sales reports.
data-collection / data-products / data-productWhat to show: a collection ID, product IDs separated by commas (shown in that order, up to 50), or one product ID. Setting one replaces the saved source. Products this website can't sell are skipped.
data-mobile-layoutLayout when the widget is 600px wide or less: grid (two per row), swipe (one row to swipe through) or list (one product per row). Grid, scroller and carousel only.
data-sold-outSold-out products: keep (in place, with a badge; the default), end (after the available ones; with a collection, within each page loaded) or hide.
data-limit, data-columns, data-autoplayProducts per page (1–24, 8 by default), desktop columns (1–6), seconds between carousel slides (0 turns it off).
data-heading, data-labelHeading above the products; buy button text.

Products with options (size, color…) open a popup with a gallery, a variant picker and a quantity field. Only products the store has made available to this website are shown.

Cart

  • The cart line from part 2 shows the cart icon with an item count. Put it in the site-wide header and load the script on every page, so the icon works everywhere. Clicking it opens the cart as a panel over the page.
  • Adding a product opens the cart. Without a cart line, a floating cart button appears once something is in the cart.
  • The cart is stored in the visitor's browser per domain (localStorage, no cookies), survives reloads and syncs across tabs. www. and the bare domain keep separate carts.
  • Checkout opens in the same tab, at the top level even inside an iframe, on the store's own checkout.
  • Your own button can open it: window.FikSatellites?.openCart() (FikSatellites exists once the deferred script has run).

Language and market

  • Language follows the page's <html lang="…"> when the store offers that language: product translations from the store, the checkout language, button and cart text, and the price format. Bilingual sites usually set this per page already. lang="fr" without a region uses the store's country for the price format. A language the store doesn't offer falls back to the store owner's default language for this site, so products, cart and checkout never mix languages.
  • The widgets' own text (buttons, cart, messages) comes in English, Spanish, French, German, Italian, Portuguese, Dutch and Catalan. In any other language the store offers, products and checkout follow the page and that text is in English.
  • To force a language on a page, add data-locale="en-GB" (or another locale, such as fr-FR or pt-BR) to the script tag.
  • Market (prices, currency, what's available) is set by the store owner. A cart has a single currency, so it's the same on every page of the website.

Styling

Widgets render inside a Shadow DOM, so the site's CSS can't accidentally break them, and their CSS can't leak into the site. They inherit the site's font unless the store owner chose one. The store owner sets accent color, corners and font; you can override them with CSS custom properties on the widget's placeholder or any ancestor. The product popup and the floating cart sit at the end of <body>, so set their colors and font on :root or body.

Two prefixes: --fik-* brand tokens are shared by all fik apps on the page; --fsat-* override them for this product. Set your brand once with --fik-*, and use --fsat-* only where Fik Satellites should look different. Layout properties (columns, gap, card widths, image ratio) only have --fsat-*.

/* Brand tokens, shared by every fik app on the page (including the product popup and floating cart) */
:root {
  --fik-accent: #ec98ca;
  --fik-radius: 8px;
}

/* Fik Satellites only: --fsat-* wins over --fik-* */
:root {
  --fsat-radius: 0px;
}

/* One placement */
.home [data-fsat-widget] {
  --fsat-image-ratio: 4 / 5;
}
PropertyBrand tokenDefaultControls
--fsat-accent--fik-accent#0b0b0b *Buttons, cart badge, highlights
--fsat-accent-hover--fik-accent-hoverautoButton hover. By default the accent, slightly lighter (dark accents) or darker (light ones)
--fsat-button-text--fik-button-textautoText on accent buttons. White, or dark when the accent is light enough that white would be hard to read
--fsat-text--fik-text#111111Text
--fsat-muted--fik-muted#6b6b6bSecondary text, compare-at prices
--fsat-bg--fik-bg#ffffffPopup and cart background
--fsat-font--fik-fontinherit *Font family
--fsat-radius--fik-radius0px *Corners of images, buttons, cart
--fsat-gap–20pxSpace between cards
--fsat-columns–4 *Columns when the widget is wider than 900px
--fsat-columns-tablet–3 *Columns between 600 and 900px (tablets, sidebars); 2 below 600px
--fsat-card-width-mobile–70%Card width in mobile swipe rows
--fsat-card-max-width–320pxWidth of the single product card
--fsat-image-ratio–1 / 1 *Product image aspect ratio
--fsat-surface--fik-surfacetransparent *Background of bordered and raised cards
--fsat-border--fik-borderauto *Lines and borders (text mixed into the background)
--fsat-sale--fik-saletext *Sale price
--fsat-font-scale–1 *Text size factor (0.9, 1 or 1.12)
--fsat-title-weight–600 *Product name weight
--fsat-title-transform–none *Product name case (none or uppercase)
--fsat-heading-size–22px *Widget heading size
--fsat-button-height–48px *Button height (at least 44px on touch screens)
--fsat-button-transform–uppercase *Button text case
--fsat-button-weight–700 *Button text weight
--fsat-button-width–100% *Button width
--fsat-button-bg–accent *Button background (solid, outline or soft style)
--fsat-button-border–accent *Button border
--fsat-image-fit–cover *Product image fit (cover or contain)
--fsat-image-radius–corners *Corners of product images (24px at most by default)
--fsat-cart-width–420px *Cart drawer width
--fsat-cart-offset-x–20px *Floating cart button: distance from the side
--fsat-cart-offset-y–20px *Floating cart button: distance from the bottom
--fsat-cart-offset-y-mobile–20px *Floating cart button: distance from the bottom on phones

* Or the store owner's setting.

The store owner can also style each widget in the app. To change that for one placement, add these attributes to its placeholder. Your CSS custom properties win over everything; placeholder attributes win over the store owner's settings.

AttributeValuesOverrides the store owner's setting for this placement
data-contentimage title vendor price compare unit badge button descriptionWhat each card shows, as a space-separated list (replaces the saved list).
data-image-ratio1/1, 4/5, 3/4, 2/3, 16/9, 3/2Image shape.
data-image-fitcover, containFill the frame or show the whole image.
data-hoverzoom, second, noneImage effect on hover.
data-card-styleplain, bordered, raisedCard look.
data-align-textstart, centerText alignment in cards.
data-alignstart, center, endButton position (product and buy button).
data-schemesite, inverseThe store owner's colors, or their dark section colors.
data-button-sizesm, md, lgButton size.
data-button-widthfull, autoFull-width button, or as wide as its text.
data-show-pricetrue, falsePrice on the buy button.
data-sale-badgeoff, label, percentSale badge on discounted products.
data-heading-sizesm, md, lgHeading size.
data-heading-alignstart, centerHeading alignment.
data-gaptight, normal, roomySpace between cards.
data-orientationvertical, horizontalProduct card: image on top or beside the details.
data-after-adddrawer, toast, noneAfter adding to cart: open the cart, show a message, or only update the cart button.

The cart placeholder takes data-corner, data-toggle, data-icon, data-count, data-show-empty, data-scheme the same way.

By default, “Continue shopping” closes the cart: the shopper is already on the page they were browsing. To send it to a page instead, such as your product list, set these on the cart placeholder. They win over the store owner's setting. The page must be on this website (same address, with or without www.); links to other websites are ignored, because shoppers would arrive at an empty cart. The link opens in the same tab and closes the cart, so a section of the current page (/#shop) works too. A link to the current page without a #section just closes the cart.

AttributeValuesWhat it does
data-continueclose, link, offWhat “Continue shopping” does: close the cart, go to a page, or hide it.
data-continue-urlA page on this websiteThe page “Continue shopping” goes to. On its own it implies data-continue="link".
data-empty-linkA page on this websiteThe page “Continue shopping” goes to in the empty cart.
<!-- "Continue shopping" goes to the products section of this same page -->
<div data-fsat-widget="cart" data-continue-url="/#shop"></div>

For anything else, style the exposed parts with ::part():

fsat-grid::part(card-title),
fsat-scroller::part(card-title) {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

fsat-product-modal::part(modal) {
  border-radius: 12px;
}

/* Move the floating cart button above a chat or cookie button */
fsat-cart[floating] {
  bottom: 96px;
}
ElementParts
fsat-grid, fsat-carousel, fsat-scroller, fsat-collectioncontainer, heading, track, nav, card, card-media, badge, sale-badge, card-title, card-vendor, price, compare-price, unit-price, card-description, button, load-more
fsat-productcard, card-media, badge, sale-badge, card-title, card-vendor, price, compare-price, unit-price, card-description, button
fsat-buy-buttonbutton
fsat-cartcart-toggle, cart-icon, cart-count, cart, cart-title, cart-progress, cart-lines, cart-line, cart-line-image, cart-quantity, cart-remove, compare-price, cart-discounts, cart-code, cart-subtotal, cart-note, cart-notice, cart-footer, cart-empty, checkout, continue, button, toast
fsat-product-modal (the product popup)modal, modal-close, modal-gallery, modal-title, modal-vendor, price, option, option-value, quantity, button, description
— (any widget, in debug mode)error

JavaScript and events

CallWhat it does
FikSatellites.openCart()Opens the cart, e.g. from the site's own cart link.
FikSatellites.consent(true | false)Tells the widgets about analytics consent. See below.
FikSatellites.mount(root)Mounts placeholders inside root, e.g. your own component's shadow root. Rarely needed.

The widgets dispatch events on window, so the site can feed its own tracking. Each event.detail has site (the site ID), widget_id and items (GA4 format). view_item, add_to_cart, view_cart and begin_checkout also have value and currency; view_item_list and select_item have item_list_name. Events fire whatever the visitor's consent, so check consent before sending them to your own tools.

window.addEventListener("fsat:add_to_cart", (event) => {
  console.log(event.detail.widget_id, event.detail.items);
});

Events: fsat:view_item_list, fsat:select_item, fsat:view_item, fsat:add_to_cart, fsat:view_cart, fsat:begin_checkout.

Analytics and consent

  • Every order records which website, widget and page it came from, and shows up in the store's orders labelled with the website. The checkout link carries utm_source (the website), utm_medium=storefront_widget and utm_campaign (the last widget used).
  • If the store owner set up Google Analytics 4, the widgets send GA4 ecommerce events, and the store's property also receives a page_view from your pages. If the page already has gtag, they use it; otherwise they load it with consent denied by default (Consent Mode v2). Before consent, Google receives cookieless pings; if your policy forbids any Google request before consent, tell the store owner.
  • Consent banners that support Google Consent Mode need nothing more. Otherwise call FikSatellites.consent(true) when the visitor accepts analytics, and FikSatellites.consent(false) if they withdraw it. It also updates analytics_storage on the page's own gtag, so call it only from your consent banner.
  • The widgets never load web fonts: they use the site's font or a font already on the visitor's device.

Performance and compatibility

  • The script is about 17 KB gzipped, loads with defer and is cached by a CDN. Widgets render after the page loads and fetch products live; images load lazily, so don't use a widget as your hero image (LCP).
  • A placeholder is empty until its widget renders. To avoid layout shift, give its container a min-height. If the widget fails, that space stays empty.
  • Current Chrome, Edge, Firefox and Safari (iOS and macOS 16+). On touch screens, buttons are at least 44px. Buttons and dialogs are native and labelled; dialogs trap focus and close with Esc. Motion respects reduced-motion, and autoplay pauses on hover, focus and touch.

Troubleshooting

  • Nothing shows. Add ?fsat-debug=1 to the page URL: each widget shows why it's hidden, and the console logs [fsat] messages. Common causes: a typo in data-shop or data-site (edited by hand), the widgets were switched off for this store, or the store hasn't made those products available to this website. Send the store owner the console message.
  • One widget doesn't appear (unknown widget ID). Its data-id names a widget that isn't saved for this website: it was deleted, or the ID was mistyped or copied from another website's snippet. The console says [fsat] with the ID, and ?fsat-debug=1 shows it in place. Check the ID with the store owner, or ask them for the widget's snippet again. A widget saved a moment ago can take up to about 5 minutes to be found.
  • Some products are missing. A product that's no longer available on this website (removed, sold only in other markets, or not made available to it) is skipped and the rest still show. Sold-out products may be hidden or moved to the end, if the store owner chose so.
  • Changes made by the store owner don't show. Saved widgets and settings usually reach websites within 5 minutes (up to about 10). Products and prices are always live. A setting written in the snippet itself wins over the store owner's, so remove it from the placeholder if their change should apply.
  • Content Security Policy. If the site sends a CSP header, allow the following. The Google entries are only needed with GA4; frame-src only for videos in product descriptions.
script-src  https://cdn.fiksatellites.com https://www.googletagmanager.com
connect-src https://cdn.fiksatellites.com https://*.myshopify.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com
img-src     https://cdn.shopify.com https://*.google-analytics.com https://*.googletagmanager.com
style-src   'unsafe-inline'
frame-src   https://www.youtube.com https://www.youtube-nocookie.com
  • Two copies of the script are harmless: the second one does nothing. If they differ, the first script tag on the page is used.