How Tolstoy Handles Consent with Shopify
When Tolstoy runs on a Shopify store:- If Shopify’s Customer Privacy API is present, Tolstoy follows Shopify’s analytics consent state.
- Analytics will be allowed when Shopify’s analytics state is anything other than ‘no’.
- Analytics will be blocked when Shopify’s analytics state is ‘no’.
- If Shopify’s API is not present, Tolstoy allows analytics by default unless you explicitly default to reject (see last section).
Reject Cookie Conset programmatically
You can programmatically reject cookies when a user doenst accept analytics cooikes policy like this: Reject Policy:Default Reject (No Cookies Until Accept)
If you want Tolstoy to start in a rejected state until the user explicitly accepts, set the following before loading the Tolstoy widget script:The Tolstoy SDK
A page that sends events with the Tolstoy SDK does not usewindow.tolstoyWidget. The SDK examines consent at each event, in this order:
- The
tolstoy-cookie-policyvalue inlocalStorage:rejectedblocks analytics, andacceptedallows it. Your page sets this value from the consent tool of your store. On Shopify, see Shopper consent. - Shopify’s Customer Privacy API, if the page already loaded it: the analytics state
noblocks analytics. - Cookiebot (the statistics category) and OneTrust (the performance category,
C0002), after the shopper answers. - Shopify’s Customer Privacy API: the analytics state
yesallows analytics; otherwise itsanalyticsProcessingAllowed()answer decides. - With no consent tool and no stored value, analytics is allowed.
accepted when the shopper accepts: