---
title: "Placements"
description: "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.

<Info>
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.
</Info>

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](/merchant-portal/onboarding#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:

| Configuration section | Selector keys |
| --- | --- |
| `pdp` | `offeringWidgetAnchor`, `addToCartButton`, `addToCartForm` |
| `quickView` | `addToCartButton` |
| `cart` | `lineItemContainer`, `lineItemProductImage`, `lineItemWarrantyCTAAnchor` |
| `cartDrawer` | `container` |
| `cartNotification` | (enabled flag; selectors resolved from the theme) |
| `checkout` | `offeringWidgetAnchor` |
| `shippingInsurance` | `offeringWidgetAnchor` |
| `collectionPage` | `policyProductCardSelectorList` |
| `policyProductPage` | elements to hide on the protection product's own page |
| `warrantyRegistration` | registration form and search selectors |

Rendered elements are custom elements with shadow DOM (listed in the [JavaScript API Reference](/frontend-widget-integration/frontend-widget-kit/javascript-injection#custom-elements)), so theme CSS does not affect them. Appearance is controlled by the design configuration SureBright holds for the store.

## Surfaces

<AccordionGroup>

<Accordion title="Product page (PDP)">
The main offering: plan cards (grid, stacked, dropdown, or checkbox layouts, as configured) rendered as `sb-product-widget` at the `pdp.offeringWidgetAnchor`, normally next to the add-to-cart button. The SDK follows variant changes (URL, form inputs, or theme globals) and refreshes quotes. Depending on configuration, adding to cart without a selection can open a plan modal (`sb-warranty-offering-modal`) before the item is added; the SDK intercepts the theme's add-to-cart request (form submit, fetch, XHR, or GraphQL) to add the protection line alongside the product. Shop Pay / dynamic checkout buttons are handled when the store enables it.
</Accordion>

<Accordion title="Quick view">
When the theme opens a product in a quick-view modal, the SDK detects it (`quickView.enabled`), renders the same offering inside the modal with `data-sb-widget-surface="quickview"`, and intercepts the modal's add-to-cart button (`quickView.addToCartButton`). Selection-change callbacks from here report `source: "quickview"`.
</Accordion>

<Accordion title="Cart page">
Three things can appear on the cart page, each enabled separately:

- **Add-protection call-to-action** (`sb-cart-cta`) next to an unprotected product line, anchored at `cart.lineItemWarrantyCTAAnchor` inside each `cart.lineItemContainer`. Clicking it opens the plan modal; selection callbacks report `source: "cart"`.
- **Line decorations** on protection lines: a badge (`sb-line-item-badge`) and a coverage summary (`sb-warranty-details`), with a "change plan" action where enabled.
- **Bottom cart call-to-action** (`sb-bottom-cart-cta`), a single toggle for the whole cart.

The SDK also runs **cart sync** here: it keeps each protection line's quantity equal to the product line it covers, removes protection whose product was removed (orphans), and de-duplicates protection lines, using the `_sbQuoteId`, `_variantId` and `_sbAddedAt` line-item properties.
</Accordion>

<Accordion title="Cart drawer">
The same cart surfaces inside a slide-out cart (`cartDrawer.container`). The SDK observes the drawer for open/close state and DOM re-renders and re-mounts its elements after the theme refreshes the drawer's sections.
</Accordion>

<Accordion title="Add-to-cart notification">
When enabled (`cartNotification.enabled`), the SDK places an offer for the just-added item inside the theme's "added to cart" notification/popup so shoppers can add protection without leaving the page.
</Accordion>

<Accordion title="Collection pages">
No offer is shown on collection pages. The SDK's job there is housekeeping: it hides SureBright's own protection products from product grids using `collectionPage.policyProductCardSelectorList`, so shoppers do not see "Extended Protection Plan" as a buyable product. The suppression re-runs on `popstate`, on `load`, and whenever a `sb:cart-sections-refreshed` event is dispatched on `document`, so themes that re-render grids client-side can trigger it. (The same applies on the protection product's own page, where the add-to-cart form is hidden via the `policyProductPage` selectors.)
</Accordion>

<Accordion title="Checkout">
On platforms where the SDK can run inside checkout, a compact offer (`sb-checkout-widget`: checkbox, toggle, button, or link style) is mounted at `checkout.offeringWidgetAnchor`. Shopify's checkout does not run storefront scripts; there, the offer is delivered by SureBright's checkout UI extension that ships with the Shopify app, not by this SDK. Selection callbacks from either report `source: "checkout"`.
</Accordion>

<Accordion title="Shipping protection">
A separate opt-in (`sb-shipping-insurance`) for shipping-related loss or damage, rendered on the cart page or drawer at `shippingInsurance.offeringWidgetAnchor`, with its own explainer popup. When the shopper opts in the SDK adds a shipping-protection line carrying `_sbQuotePlatform = PLATFORM_SHIPPING_INSURANCE`, re-quotes it as the cart changes, and removes it when the cart no longer qualifies. Selection callbacks report `source: "shippingInsurance"`.
</Accordion>

<Accordion title="Post-purchase (thank-you page)">
On the order confirmation page (`/thank_you`, `/thank-you`, `/orders/…`, or `/order-confirmation`, by platform) the SDK can open `sb-post-purchase-modal`, offering protection for eligible items the shopper just bought. Accepting adds the plan to the cart for the shopper to check out; that line carries `_quotePlatform = PLATFORM_POST_PURCHASE` and `_sbPurchasedQuantity`. Selection callbacks report `source: "postPurchase"`.
</Accordion>

<Accordion title="Product registration page">
A standalone page (`sb-registration-page`) where a shopper finds a product they already own, enters the purchase date, and buys protection for it. The SDK mounts it when the URL matches the store's registration paths; by default `/pages/extended-product-protection` and `/pages/product-registration`. The Shopify app embed always injects the SDK on these paths. Selection callbacks report `source: "registration"`.
</Accordion>

<Accordion title="Bundles">
For bundle products the SDK can quote each component separately and add one protection line per component. Those lines carry `_isBundleComponentPolicy="true"`, `_bundleParentVariantId`, `_bundleParentProductId` and `_componentQuantity`, and cart sync keeps them aligned with the bundle's quantity. Bundle handling depends on the store's bundle app and is enabled per store.
</Accordion>

</AccordionGroup>

## 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](/frontend-widget-integration/frontend-widget-kit/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-api` via `Shopify.loadFeatures` and listens for the `visitorConsentCollected` document 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.loadFeatures` is 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](/merchant-portal/widget-options), [Building your own offer](/merchant-portal/widget-options#building-your-own-offer).
