Placements
Where the SureBright widget can appear on a storefront, how each surface is anchored, and how analytics and consent work across them.
The SDK can render the protection offer on several surfaces. Each one is switched on per store and anchored to your theme with CSS selectors that SureBright keeps in the store's widget configuration, not in your code. When the SDK starts it fetches that configuration, works out which page it is on, and mounts only the surfaces that are enabled for that page.
Nothing on this page needs code from you. If a surface is missing, mis-anchored, or appears where it should not, tell SureBright which page and element it should attach to and we change the selector on our side.
On stores that use Studio, these selectors are worked out by SureBright's store onboarding agent. It drives a real browser through the storefront, finds the anchor for each surface, and checks it against the live page before the design is saved. See The storefront scan.
How anchoring works#
For each surface the configuration carries one or more CSS selectors (the anchor) plus, where it matters, an insertion position relative to the anchor (beforebegin, afterbegin, beforeend, afterend; the default is beforeend). If none of the configured selectors match, the SDK tries a per-platform list of fallback selectors (fallbackAnchorSelectorsList) and, failing that, logs the miss in debug mode and renders nothing. Selectors are grouped by surface:
Rendered elements are custom elements with shadow DOM (listed in the JavaScript API Reference), so theme CSS does not affect them. Appearance is controlled by the design configuration SureBright holds for the store.
Surfaces#
Analytics events and consent#
Every surface reports shopper interactions to SureBright's event collector so the merchant portal can show offer impressions, plan clicks, add-to-cart with and without protection, and experiment exposure. The event names and payload are documented in Event Collector.
Events are buffered and sent in batches of up to 10; add-to-cart events are sent at once. Events that could not be sent are kept in sessionStorage (sb_analytics_pending_event_list) and retried on the next page load.
Consent gating on Shopify#
On Shopify storefronts the SDK honours the shopper's privacy choices through Shopify's Customer Privacy API:
It loads
consent-tracking-apiviaShopify.loadFeaturesand listens for thevisitorConsentCollecteddocument event.Analytics are sent only when
analyticsProcessingAllowed()is true, or the current visitor consent for analytics is not"no". Until consent is known, events stay buffered; once consent is granted the buffer is flushed, and if it is refused nothing is sent.Stores that do not use Shopify's consent banner (so
Shopify.loadFeaturesis absent) are treated as allowed.
On non-Shopify platforms the SDK has no consent integration and always reports. If your storefront has its own consent manager and must block SureBright analytics, tell SureBright; there is currently no public switch for it in the SDK.
Widget rendering and cart behaviour are never gated by consent; only analytics reporting is.
See also: What merchants can change on the widget, Building your own offer.