Consent & compliance

Consent & compliance

Tocadule tracks consent on two independent lanes, sent on every event:

LaneField on the eventWhat it gates
Analyticsconsent_stateWhether we keep a visitor id (anonymous_id) on events and may link the browser to a contact for our reports
Advertisingad_consentWhether — and how much of — an event is forwarded to ad destinations (Meta, Google Ads, TikTok, ChatGPT Ads); alone, it keeps the visitor id for the ad match only

These are separate on purpose: a visitor can allow analytics but deny advertising, and the two decisions never leak into each other. Marketing permission (email / SMS / phone / WhatsApp) is a third, separate record on the contact, not a CMP lane (see Marketing permission). The plain-language version of this page is Consent and marketing permission.

Each lane carries one of three values:

Anything else the snippet might send is normalized to null server-side. unknown and null are not consent: they are treated exactly like denied, on every store. There is no workspace setting that changes this.


The analytics lane — consent_state

consent_state decides whether we keep an identifiable record of the visitor.

We keep an identifier for our analytics only when the lane is granted. denied and unknown (no banner, or a banner not answered yet) put the snippet in cookieless mode — unless the advertising lane is granted (see Ads only below):

  • No anonymous_id is written to localStorage or cookies, and none is stored on any event — the backend counts the visit through a daily-rotating visitor_session_hash (IP + user-agent) instead, so analytics still work without a persistent identifier.
  • The analytics browser ID we bake (_ga) is removed.
  • Popup throttle/impression state moves from localStorage to sessionStorage (session-scoped, treated as strictly-necessary).
  • Carts are told apart without an identifier: the server keeps up to 10 carts per daily hash and matches each snapshot to the cart it overlaps most, and a page that already saw the cart reports the add itself, so two refused visitors on one network keep separate carts and adds count once (see Cart tracking).
  • Location is the city, not the address. The IP is used in the moment (the day's hash and the country, region and city) and never stored; postal code and time zone are kept only for a consented visitor, latitude / longitude for nobody. A city condition in a segment or popup matches every visitor.
  • No raw IP address or user agent is stored.
  • The browser is never linked to a contact for analytics: no full link is written, not by identify(), not by a purchase. identify() and our popup forms still create or update the contact — it is your customer record — but the browser's rows stay anonymous; the event sent together with identify() carries the contact with no browser key, and an order counts once. No row holds both a contact and the hash. An email on any other event is only that event's ad match: it never makes a contact.
  • What reaches the ad platforms follows the advertising lane alone. If that buyer refused analytics but allowed advertising, the order is sent full with their hashed details.

Ads only: advertising without analytics

With the advertising lane granted and analytics not (as Google consent mode separates ad_user_data from analytics_storage), the snippet keeps the lasting browser id for the ad match only:

  • it rides each event's forward but is never stored on an event row; our person features (the contact id on the device, recently viewed, the shared visit state) stay off;
  • identify() ties the browser to the contact with an ads link: read only by the ad sends, never by a report, a segment or the person; nothing earlier is joined to the contact;
  • the browser's later events go to the ad platforms with that contact's hashed details;
  • a later analytics yes from the same browser turns the link into a full one from then on (the refused period is never joined);
  • advertising withdrawn: the link is not used; both lanes refused: the snippet drops the id.

identify() never raises a lane. It is sent at once under the lanes as they read at that moment. A refused visitor who signs up still gets a contact (with the permissions they ticked), but their browser is not linked to it for analytics. It does not grant the advertising lane either: sharing your email for a receipt is not opting into ad targeting.

The advertising lane — ad_consent

ad_consent never affects your dashboards. It only controls what leaves Tocadule for ad platforms, and it does so through two send treatments, resolved from the lane value alone:

ad_consentTreatmentWhat is sent
grantedfullFull server-side event incl. hashed PII + click IDs — highest match quality
denied, unknown / nullnothing, or a countOnly when the destination counts the not-consented (its option): the event and its value, no personal data
  • full — everything: hashed email/phone/name + click IDs.
  • count — strip PII and click IDs; the event, its value and products, the page without its query, the user agent and a visitor id that changes every day. Sent only by a destination whose Count the not-consented option is on (each GA4, Meta and TikTok destination's settings; off for a new destination, skip reason consent_not_granted otherwise). Google Ads and ChatGPT Ads never send one. A count shows in the platform's totals, never in ROAS.

What a refused visitor's event carries

Where a count is sent (a destination with its Count option on), it counts, but nothing in it leads back to the person:

  • Sent: event name, time, value, currency, product IDs, the browser's user agent (no IP), and a day-rotating ID made with a secret key, so no two days can be joined.
  • Never sent: email, phone, name, IP, click IDs, a persistent visitor ID, device details beyond the user agent.
  • The order number never leaves as-is. It is personal data (your order system ties it to a name and an address), so wherever it would appear — transaction_id / order_id, an event ID built from it (shopify-order-…, a server API event_id) — it is replaced by a hash made with a secret key that only Tocadule holds. Nobody can turn it back into the number; GA4 still pairs a refund with its purchase because both carry the same hash.
  • The page address goes without its query string (it can hold order numbers, emails and click IDs); for checkout and purchase events only the site address goes.

Inside Tocadule the order keeps its real number, whatever the consent: it is your own order record, and it is how a cancellation finds its purchase.

For your privacy notice. Suggested sentence (adapt it with your legal adviser):

Even if you decline advertising cookies, a purchase you make is counted by the advertising platforms we use (Meta, TikTok, Google Analytics) without anything that identifies you: no name, email, phone or IP address, and no identifier that links your visits.

Türkçe: Reklam çerezlerini reddetseniz bile, yaptığınız alışveriş, kullandığımız reklam platformlarında (Meta, TikTok, Google Analytics) sizi tanımlayan hiçbir bilgi olmadan sayılır: adınız, e-postanız, telefonunuz ya da IP adresiniz ve ziyaretlerinizi birbirine bağlayan bir kimlik gönderilmez.

On the browser side, denying the ad lane also deletes the ad browser-IDs we baked (_fbp, _ttp, _fbc). IDs the merchant's own pixel set are left alone — they belong to the merchant's own consent flow.

GA4 is gated by the analytics lane, not this one. GA4 is measurement, not advertising, so its server-side forwarding is keyed off consent_state — only Meta, Google Ads, and TikTok are gated by ad_consent. Not consented, GA4 sends nothing — or, with its Count option on, a count: the day's visitor as its client id and "denied" ad flags. GA4 does not model it (the Measurement Protocol carries no analytics consent): it is a visit of that day's visitor. A GA4 destination connected before the option keeps counting. Its ad_user_data / ad_personalization flags are GRANTED only when ad_consent is granted.

One part of a GA4 event follows the advertising lane: the contact's hashed email / phone / name (GA4 user-provided data), because Google passes it on to Google Ads. It is sent only when ad_consent also resolves to full; a visitor who granted analytics but denied ads is measured in GA4 without it.

⚠️

GPC is a hard ad-denial. If the browser sends a Global Privacy Control signal (navigator.globalPrivacyControl === true), the advertising lane is forced to denied regardless of any CMP state.


How the snippet reads consent

You usually don't wire anything up. Before every event the snippet reads both lanes again, in this order, and never waits:

  1. Your statement — tocadule.setConsent({ analytics, ads }) for the visitor (in the install code, so it works before the snippet loads), or a form's track(name, props, { consent: { ads } }) for that one event: ads only (below)
  2. GPC (ad lane only — a hard denial)
  3. Your settings (Settings › Privacy & Consent, below) — they alone decide:
    • Banner = yes (which one): your banner's answer — its own stored answer (its cookie: Cookiebot, OneTrust, CookieYes, Complianz, Didomi, Usercentrics …; on Shopify the storefront's own consent), then Google Consent Mode v2, then the banner's code (IAB TCF v2, the Cookiebot / OneTrust objects) as it loads and every change it announces. A returning visitor's answer is known from the first event. Where your banner shows nothing (a region it is not set up for), its own region rule answers. No answer: not consented
    • Banner = no, Collection = everyone: every visitor consented
    • Banner = no, Collection = by consent (the default): no visitor consented

Our own record of an earlier answer is not an answer: a consent your banner let expire, or a setting you changed, is not carried on. Every event says what decided each lane (consent_by), and the row keeps it (consent_source).

Your banner, and Collection

Your banner is your setting. Choose it in Settings › Privacy & Consent: no banner (the default), or which one. With a banner, a page where it was slow or blocked is a page with a banner whose answer has not come, never "no banner". When the snippet sees a banner on your site and your setting says no banner, the setting still decides; the page shows one warning line so you can check it. A banner we do not recognise: tell us the answer with tocadule.setConsent.

Collection is offered only with Banner = no: what we take from every visitor.

CollectionEvery visitor
By consent (default)not consented: anonymous, nothing to ad platforms but a count where a destination counts
Everyoneconsented on both lanes — your statement; kept with who set it and when

It also decides an order whose browser we did not see (a checkout on another domain, a phone order), a Server API event without consent, and an imported order.

Before the visitor answers

  • Nothing waits. Every event is sent at once with the lanes as they read at that moment; the answer applies from the next event on.
  • Nothing is kept before a grant. _toc_aid is used only once the analytics lane reads granted; on a refusal our ids are removed from the device. While your store's setting has not reached the page yet, an event proposes the lasting id (proposed_anonymous_id, in memory only); we accept it only when your flow allows (no banner + Collection = everyone) and never store a rejected one. With a banner, nothing id-like is sent before the visitor's answer, and a fresh id is made at their yes.
  • Nothing is carried across a grant. A yes in the middle of a visit starts a new visit from then on; the landing's source and click IDs stay with the visit before it. Events sent before the grant are never linked to the visitor afterwards.
  • Popups never wait. Bars, popups and widgets show as usual, under the banner.

Stating consent yourself

// In the install code: your own answer, for both lanes, until you call it again
tocadule.setConsent({ analytics: true, ads: false });
 
// One event only (your own form, say): this send's ads answer as stated — ads only
tocadule.track('lead', { form: 'contact' }, { consent: { ads: true } });

Two levels:

  • Visitor consent — the banner, or tocadule.setConsent({ analytics, ads }): both lanes, every event. It is the one way to state the analytics lane in the browser; on your server it is consent on the Server API.
  • Form consent — track(…, { consent: { ads } }): the ads lane only, that send only. An analytics on an event is ignored: a form never ties a browser to a person.

identify and these statements are yours: sending them right — and how the person gave that consent — is your responsibility. A send made under your stated answer is marked in the send record. Our popup forms do the same with a consent box: a box that grants ads sends that submission's lead to the ad platforms in full, whatever the banner said (the old "Send to ad platforms" switch is gone).

identify(email, traits) writes the contact whatever the banner says; a track() called right after it, in the same task, travels with it in one request and belongs to that contact. An email or phone you put on any other event is only that event's ad match: it never creates a contact and is never stored.

What goes on the wire

Every track() and identify() request carries both lanes, what decided them and the banner seen on the page:

// track() body (an identify() of the same task rides along as `identify`)
{ workspace_id, anonymous_id, event, properties, context, consent_state, ad_consent, consent_by, cmp, identify? }
 
// identify() body, when it goes alone
{ workspace_id, anonymous_id, email, traits, user_language, consent_state, ad_consent, consent_by, cmp }

Whatever a request carries, the ingest seam strips personal data (email, phone, names, addresses, national id, birth date, user_data, the personal fields inside traits) before the event row is stored. An email-shaped value in a page address or a search term becomes redacted.

tocadule.cart() is PII-free by design — it carries the anonymous_id and the cart contents only, and resolves to a contact through the identity map. Never put an email on the cart; the cart payload has no consent fields of its own because it stores no personal data.


Marketing permission is not a consent lane

Marketing permission (email, SMS, phone, WhatsApp) lives on the contact, completely separate from the two CMP lanes above. It governs whether you may send messages to a contact, not whether you may track them.

  • No subscription without evidence. Every door that creates a contact (identify, forms, popups, Shopify, import, the panel) creates it not subscribed unless the same call carries a permission.
  • One log. Every change is appended to the contact's permission log (contact_consents: channel, granted / denied, source, basis, time, evidence); the newest record per channel decides, and subscribed_* stay in sync with it. A backdated record never wins over a newer one, and an email grant older than an unsubscribe changes nothing.
  • Signals:
    • identify() traits (only: a tracked event — a form event, an order, a login — never writes a permission): subscribed_email / subscribed_sms / subscribed_phone / subscribed_whatsapp (true grants, false withdraws). These are the only keys that grant or withdraw. Every other trait (consent_etk, your KVKK / terms boxes, your own keys) is stored on the contact and the event exactly as you send it and is never read as a permission. A single "commercial electronic messages" (ETK) box: send subscribed_email, subscribed_sms and subscribed_phone as true when it is ticked, and leave them out when it is not (an unticked box is not a withdrawal).
    • Your preference page: an identify() call with the per-channel subscribed_* traits (both "on" and "off"): grants and withdrawals.
    • Tocadule popup forms: an email given grants email, a phone given grants SMS (basis form_submission, evidence: popup id, version, page). A consent box decides its own permissions instead — a list (email, SMS, WhatsApp, phone; ads sends that submission in full): ticked grants, unticked grants nothing; the evidence keeps the box's text and what it granted.
    • Shopify email_marketing_consent / sms_marketing_consent (legacy accepts_marketing only when absent), dated with Shopify's consent time.
    • The panel and contact imports: explicit subscribed / subscribed_<channel> values, recorded as merchant-attested.
    • The unsubscribe link, Resend bounces and complaints: email withdrawn.
// Sign-up with explicit opt-in, sent once on submit with the boxes' final state
tocadule.identify('shopper@example.com', {
  first_name: 'Ada',
  subscribed_email: true,
  subscribed_sms: false
});

Identity, dedup & geo (compliance notes)

Linking a visitor to a contact for analytics happens only when the analytics lane allows it (with ads alone, an ads-only link serves the ad sends), through identity calls: identify() (for logged-in shoppers, once on logged-in pages), our popup forms, and identify right before a purchase. Once linked, the browser's earlier events resolve to the contact too. Behaviour events carry no email. See Identity & contacts.

Deduplication is automatic. Browser events dedupe on anonymous_id; external/server events dedupe on source_event_id. Merchants never set dedup IDs.

Location is handled two ways, deliberately:

  • Event location is resolved from the real client IP via MaxMind GeoLite2 (kept in our database) — the single source of truth for country / region / city / postal / timezone. A visitor who did not consent gets country, region and city; postal code and timezone need a granted lane. Coordinates are not kept. Location segments read the place of the person's visits.
  • Contact-profile location is declared-only. It is set only from what was declared — identify() traits (country, city), a CSV import, the Shopify address — never from a popup form, and never inferred from an IP. An IP says where a request came from (proxy / VPN / travel), not where a person lives, so we never freeze an inferred country onto a contact.

Custom events

Any event name is accepted — tocadule.track('wishlist_added', {...}) stores exactly as sent. Unknown names are treated like every other event: written to the events table, visible in the raw event stream on the Events page, and usable in segments and automations by their literal name.

What they don't get is the built-in canonical treatment: only the standard names feed the Events page cards, the commerce funnel, and the ad-platform gap report (event matching is exact — a different spelling is stored as a custom event), and only standard commerce events get a suggested standard destination event (Meta AddToCart, GA4 view_item, …). Prefer the standard event names when a matching one exists; reach for a custom name only when nothing fits.