Your events never count toward Shoppable Videos view billing, and they never change the numbers of your Tolstoy widgets: they are not opens, engaged shoppers, try-ons, add to carts or revenue.
Add the SDK
The SDK is an ES module on the Tolstoy CDN. Create one SDK on the page, and send each event withtolstoy.analytics.track():
The SDK throws an error when
appKey or the event name is empty. It sends the events in batches: every 10 seconds, when 10 events are in the queue, and when the shopper leaves the page. Tolstoy drops an event that is larger than the limits above.
Shopper consent
The SDK sends no event and stores no shopper ID until the shopper allows analytics. It drops the events from before that; it does not keep them for later. At each event, the SDK reads thetolstoy-cookie-policy value in localStorage: accepted allows analytics, and rejected blocks it. Your page sets this value from the consent tool of your store, before the first event and again when the shopper changes the answer. The SDK does not load a consent tool and does not wait for one. See Cookie Consent for what the SDK does without the value.
On Shopify, get the answer from Shopify’s Customer Privacy API:
startTracking and the code that it uses: when the page already loaded the API, Shopify calls the callback at once. With a different consent tool, call passConsent from the consent callback of that tool.
Read the results
The report reads tables that Tolstoy builds each night. It covers full UTC days before today. The events of today show after the next build, from about 06:30 UTC. With the Tolstoy CLI:events lists each of your events with the widget type tolstoy-sdk, its name, the number of events and the number of shoppers who sent it:
--app-urlselects a store fromtolstoy stores list. Without it, the CLI uses your default store.--channel(weborapp) limits the report to your website or your Tapcart app.
get_store_analytics tool returns the same report. Ask for the details section.
The CLI and the MCP read only the stores of the workspace that you signed in to.