Analytics and consent
What the SureBright SDK records about shopper interactions with the protection offer, how it honours Shopify customer privacy consent, and what is never recorded.
The SDK records how shoppers interact with the protection offer so the merchant portal can show offer views, plan clicks, add-to-cart with and without protection, and experiment results under Sales. This page is for merchants and developers who want to know exactly what is sent, when, and how consent is respected. The raw endpoint and payload are documented in Event Collector.
What is recorded#
Each row is one event sent to SureBright. The wire names are the et values in the collector reference.
Every event carries the store id, a visit id (one per browser session), platform and storefront runtime (SHOPIFY with LIQUID, HYDROGEN or SHOPYFLOW), store country, the page it came from, the time, the Shopify theme id, the cart token when known, and the configuration version that rendered the offer. Where they apply it adds the quote and plan ids, product id, variant, price and quantity, plan price and term, display currency, which term was pre-selected and which wore the ribbon, and experiment and treatment ids. Events are tagged with the SDK build (sim-x) and an isBot flag.
What is never recorded#
No customer name, email, phone, address, order number or payment detail is ever part of an event. The SDK reads none of these. The cart token and visit id are the only identifiers, and neither is tied to a person.
The following is also dropped before it is sent:
Anything from a Shopify theme-editor preview (
Shopify.designMode) or a SureBright design preview. These are not shoppers.Errors raised by crawlers. A client whose user agent names a bot, crawler or spider, or that runs under browser automation, is tagged
isBot: true; its other events are kept, tagged, so they can be filtered.Events with no store id. A headless storefront that omits
data-sb-store-idproduces none; see Headless and custom storefronts.
Where events go#
Events are buffered in the page and posted to SureBright's event collector in batches of up to 10, every 5 seconds, when a batch fills, or when the page is hidden or unloaded. ADD_TO_CART is sent at once. Events that could not be sent are kept in sessionStorage under sb_analytics_pending_event_list (at most 100) and retried on the next page in the session. From the collector they feed the Sales analytics in the merchant portal. The SDK sends events to SureBright only; it does not load or call any third-party analytics script.
Consent on Shopify#
On a Shopify Online Store theme the SDK follows the shopper's choice in Shopify's Customer Privacy API, the same source your cookie banner writes to.
The SDK loads Shopify's consent API
When the page has
Shopify.loadFeatures, the SDK loadsconsent-tracking-apiand listens for thevisitorConsentCollecteddocument event.Until the choice is known, nothing is sent
Events are recorded into the buffer but no request leaves the page. The buffer is also saved to
sessionStorage, so a shopper who answers the banner on a later page still gets their earlier interactions counted.Consent given
If
analyticsProcessingAllowed()is true, or the visitor's analytics consent is anything other than an explicitno, the buffer is flushed and recording continues normally.Consent refused
The buffer is discarded, the saved copy is cleared, and the SDK records nothing further on that page.
A store that does not use Shopify's consent banner (no Shopify.loadFeatures on the page) is treated as allowed, which matches Shopify's own behaviour for stores with no privacy settings. On Hydrogen, Shopyflow and non-Shopify platforms the SDK has no consent source and records as soon as the shopper interacts; if your storefront runs its own consent manager and must gate SureBright, tell SureBright, since there is no public switch in the SDK today.
Consent gates reporting only. The offer still renders, plans are still added to the cart, and cart sync still runs whatever the shopper chose. None of those depend on analytics.
Checking what is sent#
Add ?sb_debug to a product URL and watch for [SB] [ANALYTICS] lines in the console; each track and flush is logged. In the Network tab, filter on /events/api/event to see the batches and their eventList bodies. If you see track lines but no requests on a Shopify store, the consent API has not yet reported a choice; answer the banner and the batch will leave.
If your storefront renders the offer with its own UI, or runs where the SDK cannot see the interaction, you have to send these events yourself; the field list, the minimum set that makes a store visible in Sales, and a worked example are in Event Collector.