Consent
Understand when the Cevoid Analytics SDK creates a session, when it does not, and how consent affects session IDs.
Use this page when you need the exact rules for Cevoid session creation and the ca_session cookie. If you only want the operational setup steps, use Session tracking instead.
Short answer

Every tracked event carries a session_id for the current page runtime. The SDK only writes that session to the ca_session cookie, so it lasts across page loads, when both of these are true:
enableSessionTrackingis enabled- The consent checks resolve to granted
If consent is denied, events can still be sent, but ca_session is not written, so the session_id lasts only for the current page runtime. Cevoid only uses sessions stored in ca_session to connect widget activity with completed orders.
On a non-Shopify site with no GTM consent entry and no window.cevoidTrackingConsent value, the consent checks default to granted.
To send nothing at all until a visitor grants consent, turn on requireConsent. Then consent that no consent tool has answered counts as denied.
Session cookie name
The current Cevoid session cookie name is ca_session.
cevoid_sid is the legacy cookie name. The SDK will migrate an existing legacy cookie into ca_session and clean up the old cookie when possible.
If your storefront requires cookie disclosures before analytics storage is enabled, document ca_session in your cookie policy before you turn on session tracking in production.
Consent sources
When session tracking or requireConsent is on, the SDK checks up to three sources, described below. Consent resolves to granted only when every check resolves to granted. If none of these sources are present on a non-Shopify site, the overall consent result defaults to granted, unless requireConsent is on: then it counts as denied.
Shopify Customer Privacy API
If Shopify is not present, this check defaults to granted.
If Shopify is present, the SDK tries to load the consent-tracking-api feature and waits up to 5 seconds:
- if the feature loads, it uses
window.Shopify.customerPrivacy.userCanBeTracked() - if feature loading fails or times out, the Shopify check resolves to denied
GTM dataLayer
If window.dataLayer is missing, is not an array, or holds no consent command, this check defaults to granted.
If consent commands are present, the SDK reads analytics_storage from the latest ['consent', 'default' | 'update', {...}] style entry that sets it:
analytics_storage === 'granted'means granted- any other value means denied
If consent commands are present but none of them sets analytics_storage, this check resolves to denied.
window.cevoidTrackingConsent
If this global is missing, this check defaults to granted.
If it is present:
'granted'means granted- any other value means denied
What happens when consent is granted
If consent resolves to granted, the SDK:
- creates or refreshes
ca_session - uses a 30-minute rolling expiry
- keeps the same
session_idon tracked events across page loads
Cookie attributes:
- Name:
ca_session - Path:
/ - SameSite:
Lax - Domain: only set when you pass
cookieDomain
What happens when consent is denied
If consent resolves to denied:
- the SDK removes
ca_sessionand the legacycevoid_sidcookie - the SDK does not create
ca_session - tracked events can still be sent, unless
requireConsentis on - those events carry a fresh
session_idfor the current page runtime only, never the value of an earlierca_sessioncookie
What is sent without consent
Without requireConsent, consent never stops events from being sent. It changes only the fields below; every other field of the request is the same either way. "With consent" means enableSessionTracking is on and the consent checks resolved to granted.
| Field | With consent | Without consent |
|---|---|---|
session_id | The ca_session cookie value, kept for 30 minutes after the last event. | A random ID for the page load, kept only in memory. If a ca_session cookie from earlier consent exists, the SDK deletes it and never sends its value. |
has_session_cookie | true | false |
Send nothing until consent
Turn on requireConsent when your storefront must not send any analytics before a visitor grants tracking consent. It is off by default.
- Script tag:
data-require-consent="true" - npm:
init({ publishableKey: 'cev_pk_...', requireConsent: true }) - React:
<Analytics publishableKey="cev_pk_..." requireConsent />
With requireConsent on:
- the SDK sends no events, and no
session_id, until consent is granted - consent that no consent tool has answered, denied consent and a consent check that fails all count as denied
- events tracked while consent is not granted are dropped, and so are queued events when a visitor withdraws consent
cevoid:*browser events still fire on the page, so forwarding to GA keeps working- a consent change after page load applies at once: GTM
analytics_storageandwindow.cevoidTrackingConsentare read again before every event, and Shopify's answer when Shopify firesvisitorConsentCollected
If your consent tool is not one the SDK reads, set window.cevoidTrackingConsent = 'granted' when the visitor accepts. Without it, the SDK sends nothing.
Cevoid widgets (galleries, cards, upload forms, the loyalty widget and reviews widgets) do not read your init() options. They follow the workspace setting Only send events after consent in Settings → Analytics. That setting does not change a script tag or init() call you installed yourself, so set requireConsent there too.
What happens when cookies cannot be written
If consent is granted but the browser blocks cookie writes, the SDK falls back to an in-memory session for the current page runtime.
That fallback:
- does not persist across full page reloads
- still allows a session value to be attached during the current runtime
What happens while consent is resolving
When enableSessionTracking or requireConsent is on, tracked events are deferred until consent resolution finishes. At most 100 events wait; the oldest are dropped first.
After consent resolves:
- if granted, the SDK creates or refreshes the session and then sends the deferred events
- if denied, the SDK sends the deferred events without writing
ca_session, or drops them whenrequireConsentis on
Practical examples
Gallery on a non-Shopify site with no custom consent signals
Result:
- consent defaults to granted
ca_sessionis created if session tracking is enabled- with
requireConsenton, consent counts as denied instead and no events are sent
Shopify storefront where tracking is denied
Result:
- no
ca_sessionis created - events can still be sent, with a
session_idfor the current page runtime only
Site where cookies are blocked
Result:
- no persistent
ca_session - in-memory session fallback for the current runtime only