Identity & contacts

Identity & contacts

Tocadule tracks two kinds of subject: the anonymous visitor (a browser, identified by anonymous_id) and the contact (a person, identified by email). This page explains how the two get joined, so a shopper's browsing history, cart, and purchase all attach to one contact, and so your server-side forwards to Meta / TikTok / Google carry a real identity instead of an anonymous hit. The plain-language version is Customer identity and personal data.

The rule: events say what happened, the contact says who

  • Events carry no personal data. Email, phone, names, addresses, national id, birth date, user_data and the personal fields inside traits are removed by the ingest seam before any event row is stored, on every door (browser, Shopify, Server API, popups). An email-shaped value in a page address or a search term is replaced with redacted.
  • identify = who: identify (its traits are the person: email, phone, first_name, last_name, full_name, city, region, postal_code, country, birthday, gender, customer_id, subscribed_*), Tocadule popup forms, Shopify and your panel / CSV create or update the contact, the only place personal data is stored. An event called right after identify, in the same task, travels with it and belongs to that contact. An email, phone or name on any other event is only that event's ad match: never stored, never a contact. If you call identify, don't put the email on the event; if you don't (you don't want a person record), put it on the event for its ad match.
  • Ad platforms read hashed email / phone from the contact (or the event's own, for that event only), and only when the visitor allowed advertising. See Destinations & match quality.

The three-part join

Every browser event is stored against an anonymous_id. A contact is a row keyed by (workspace_id, email). The two are connected by the identity_map table: one row per (workspace_id, anonymous_id) → contact_id.

anonymous_id  ──►  identity_map  ──►  contact
(the browser)      (the join)         (the person: email, name, phone, …)

Once a browser is in identity_map, all of its events resolve to the contact, including the ones it sent before it was identified: reports, segments and attribution read the person through identity_map, so a consented shopper's whole journey joins their contact.

anonymous_id is the browser's ID, stored client-side as the _toc_aid cookie / localStorage value. The snippet generates it for every visitor except in cookieless mode: when neither the analytics nor the advertising lane is granted it clears _toc_aid and sends no anonymous_id, and the backend counts those visits with a daily-rotating hash instead. With only the advertising lane granted it keeps the id for the ad match: it rides the events but is never stored on a row. You never set it yourself.

When a browser is linked

A browser is linked to a contact for reports only when the analytics lane is granted. A refusal or no answer is never overridden, not even by identify().

Each link has a purpose: full (analytics granted: reports, segments, the person, ad sends) or ads (only the advertising lane granted: ad sends only — no report, segment or person ever reads it, and nothing earlier is joined to the contact). A later analytics grant from the same browser turns an ads link into a full one from then on; the refused period is never joined.

DoorContactBrowser linked
identify(email, traits)Created or updated, alwaysOnly when the lane allows; otherwise the call carries no anonymous_id and no identity_map row is written
Form events, popup formCreated or updatedOnly when the lane allows
purchase after identify (one request)Created or updated by the identify, whatever the banner; the purchase carries itOnly when the lane allows; a refused buyer's purchase keeps no browser key
Any event that carries an email (no identify)Never: the email is that event's ad match only, then strippedNo
Shopify order / customerCreated or updatedOnly when the browser that placed the order allowed it (_toc_aid cart attribute, else the browser that held the same cart token); a refused order carries no browser key. With no answering browser found, the order is looked at again about 3 minutes later; still none → no lanes, which is not consent (modeled forward, no browser key)
Server API /v1/eventsNone (order cancellations only)No

A refused buyer who comes through both doors (browser purchase + Shopify order) is counted once, and no row holds both the contact and the day's hash.

Logged-in shoppers: ONE line in your common template

Do not put the email on browsing events. ONE line in your site's common template calls identify when the shopper is logged in — standard, not optional: it covers login and every logged-in page, re-links a new browser id (Safari's 7-day cookie cap, cleared cookies, a new device) and opens records for members from before the install. Browsing events go without any customer details:

<script>
  // In your common template, when the shopper is logged in. Sent once per
  // browser + email per 30 days (deduped on visitor + email + traits).
  var email = `{email}`;
  if (email.indexOf('@') > 0 && email.indexOf('{') < 0) tocadule.identify(email);
</script>

Every buyer is named by identify(email) on the order page, right before their purchase (or by the Shopify order webhook). A sign-up passes the boxes the shopper ticked, once, on submit:

tocadule.identify('{email}', {
  first_name: '{firstName}', last_name: '{lastName}', phone: '{phone}',
  country: '{country}', city: '{city}',
  // the "commercial electronic messages" (ETK) box, ticked: one permission per channel
  subscribed_email: true, subscribed_sms: true, subscribed_phone: true,
  consent_etk: true   // your own record of the box: stored as sent, not a permission
});

identify(email, traits)

Signature: tocadule.identify(email, traits). Email is required; every trait is optional. The snippet sends it at once under the lanes as they read then (nothing waits for the banner) — together with the next track() of the same task, in one request — and sends it again only when the email or the traits change. It creates or updates the contact whatever the banner says (never for bot traffic) and is never forwarded to an ad platform.

TraitEffect
first_nameStored on the contact
last_nameStored on the contact
full_nameSplit into first / last only when those are absent (the last word is the last name)
region / postal_code / birthday / gender / customer_idStored on the contact's attributes (birthday / gender are Meta match keys)
phoneStored on the contact (a match key for ad platforms)
countryContact profile location: declared only (see below); unlocks location segments
cityContact profile location: declared only
subscribed_email / subscribed_sms / subscribed_phone / subscribed_whatsappMarketing permission per channel: true grants, false withdraws
consent_etkStored on the contact exactly as sent; never read as a permission. For a single "commercial electronic messages" box, send subscribed_email / subscribed_sms / subscribed_phone true when it is ticked, and leave them out when it is not (an unticked box is not a withdrawal)
Any other key (e.g. consent_kvkk, consent_terms, plan)Stored on the contact exactly as sent; never read as a permission

identify() never subscribes anyone without a permission trait, and it never grants a tracking lane. Every permission change is written to the contact's permission log with source and time (see Consent & compliance).

Contact location is declared-only. A contact's country / city are set only from what was declared — the traits you pass to identify() (account or shipping address), a CSV import, the Shopify address —, never from a popup form and never inferred from the request IP. An IP says where a request came from (proxy / VPN / travel), not where a person lives. Event rows still carry IP-based geo for analytics and the By-Geo segment. See Geo & location.

Enrichment is non-destructive: on an existing contact, blank traits never overwrite stored values. identify() also stores one canonical identify event per contact per day; it keeps the permission flags and non-personal traits, and the email, phone and names are stripped from it like from every event. A newly connected destination does not forward identify as a conversion; map your sign-up event to Lead / CompleteRegistration instead.

Cart is PII-free by design

tocadule.cart() carries only cart contents (items, total, currency, item count) plus the visitor's anonymous_id. Never put an email on the cart. It resolves to the contact through the same identity_map join once the shopper is identified.

<script>
  // cart: call on every cart change (add, remove, quantity) and on the cart page, with the WHOLE cart. Replace each {…} with your platform's token.
  var items = [];
  // inside your platform's cart loop, once per product:
  items.push({ product_id: `{productId}`, variant_id: `{variantId}`, sku: `{sku}`, name: `{productName}`,
    price: `{productPrice}`, quantity: `{productQuantity}`, url: `{productUrl}`, image_url: `{productImage}` });
  tocadule.cart({ items: items, subtotal: `{subtotal}`, currency: `{currency}`, cart_id: `{cartId}` });
</script>

An empty cart is items: []. No email or other personal data goes on the cart.

On Shopify the cart comes from Shopify's carts webhooks; it carries only the cart, never identity.

Consent and identity

Consent has two lanes:

  • consent_state (analytics): decides whether we keep an anonymous_id on events and whether a browser may be linked to a contact for reports (with only the advertising lane, the id serves the ad match and an ads-only link). identify() never raises it.
  • ad_consent (advertising): decides what forwards to ad destinations (full when granted; otherwise nothing, or a count where the destination counts the not-consented). identify() never grants it.

Marketing permission (subscribed_email, subscribed_sms, …) is a third, separate record on the contact, not a CMP lane. See Consent & compliance.

Geo and location

Location on events comes from MaxMind (GeoLite2, offline) resolved from the real client IP — the one source for country / region / city / postal code / timezone (CloudFront's headers are not read; coordinates are never kept). A visit keeps them once; reports and segments read the visit's place.

Location on the contact profile is separate and declared-only — set from identify() traits country / city, a CSV import or the Shopify address, never from a popup form or the IP.

Dedup

You never set deduplication IDs. Tocadule dedups on:

  • anonymous_id — browser events.
  • source_event_id — external systems (Shopify webhooks, future connectors), a full unique index.

Custom event names

Any event name is accepted — tocadule.track() requires only a workspace and an event name, with no fixed vocabulary. A custom event is stored like any other and shows up in the dashboard's Events list, in the distinct-names picker, and in the event catalog (last 30 days, non-bot), where you can inspect its property keys and sample values.

Custom events don't get a pre-built card on the Data Collection page — that page shows a fixed set of standard events (page view, product view, collection view, view cart, add to cart, search, cart state, checkout started, purchase, purchase cancelled, identify, plus the Shopify-only checkout-abandoned / order-fulfilled events). And custom names are not aliased or normalized: only exact standard names feed the standard-event pipelines (gap report, ad-destination mapping). Use a standard name when you mean a standard event; use a custom name freely for anything else.

The install (for reference)

The install is a tiny async loader. A stub defines track / identify / cart / requestPush that queue calls into tocadule._q; when snippet.js loads it drains the queue, so template code that runs before the script finishes loading never silently no-ops.

<link rel="preconnect" href="https://app.tocadule.com">
<script>window.tocadule=window.tocadule||{};window.tocadule._q=window.tocadule._q||[];['track','identify','cart','requestPush','setConsent'].forEach(function(m){window.tocadule[m]=window.tocadule[m]||function(){window.tocadule._q.push([m,arguments])}});</script>
<script async fetchpriority="high" data-workspace="YOUR_WORKSPACE_ID" src="https://app.tocadule.com/snippet.js"></script>