Destinations & match quality

Destinations & match quality

Tocadule receives your events server-side, then forwards the ones you choose to ad and analytics destinations — Meta Conversions API, TikTok Events API, GA4 Measurement Protocol — from our servers, not the browser. Because the send happens server-side, it survives ad blockers, Safari ITP, and iOS ATT that silently drop the browser pixel.

This page explains how forwarding is wired, how the advertising-consent lane gates it, and how the identity you attach to an event drives match quality (Meta's EMQ score).

Match keys come from the contact, or from that event's own customer fields — never from a stored row. Event rows carry no personal data. When the visitor allowed ads, the worker hashes and attaches the match keys of: the event's own person (the one person list your code put on it, which wins field by field), else the contact the event belongs to (identified, or sent together with identify), else the contact the browser is linked to for ads only (analytics refused, ads granted), else an existing contact the event's own email names. Before a shopper is identified, their events go with browser ids only. The plain-language version is What we send to ad platforms.

The install

The snippet is a tiny async loader. A stub defines tocadule.track / identify / cart / requestPush immediately and queues calls into tocadule._q; the real snippet.js loads asynchronously and drains the queue. Nothing you call is lost while the script is still loading.

<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>

The four calls you have:

CallPurpose
tocadule.track(name, props)Record any event (standard or custom).
tocadule.cart(data)Send the whole current cart (PII-free).
tocadule.identify(email, traits)Tell us who the visitor is (sign-up, login, logged-in pages).
tocadule.requestPush(cb)Ask for web-push permission.

How an event becomes a forward

  1. You call tocadule.track('purchase', {...}). The snippet POSTs it to /events/track.
  2. The event is stored (personal data stripped), its anonymous_id is resolved to a contact via identity_map, and geo / IP / User-Agent are enriched onto it as consent allows.
  3. Tocadule looks at your destinations. Each destination has an events_to_forward list — an exact, one-to-one mapping of your event names to platform event names (e.g. purchase → Purchase). There is no alias guessing: a destination forwards an event only if a rule names it exactly.
  4. Matching destinations are enqueued to a worker, which builds each platform's payload and sends it.

Events your server sends through the server API follow the same steps.

Forwarding is opt-in per event, per destination. An event you don't map to a destination is stored and available in analytics but never leaves Tocadule. Events flagged as bot traffic are never forwarded.

Consent: two independent lanes

Tocadule reads two consent lanes from your CMP (Consent Mode v2, IAB TCF v2, OneTrust, Cookiebot, Iubenda, GPC, or an explicit override) and stamps both onto every event:

LaneFieldGates
Analytics / generalconsent_stateKeeping an anonymous_id on events and linking the browser to a contact for reports: granted only (with ads alone the id serves the ad match only). GA4 forwarding follows this lane, except GA4's hashed user data (email / phone / name), which needs the advertising lane too.
Advertisingad_consentWhether an event is forwarded to ad destinations, and how much of it.
⚠️

Ad forwarding reads the advertising lane only. A visitor who granted analytics but denied ads is not sent to ad platforms (unless the destination counts the not-consented: then a count only) — the analytics lane never stands in for the ad lane.

Marketing permission (subscribed_email / subscribed_sms, …) is a separate record on the contact — not a CMP lane, and it plays no part in forwarding.

What the ad lane decides

The lane a destination reads (the advertising lane; GA4: the analytics lane) resolves before anything is sent:

ad_consentTreatmentWhat is sent
grantedfullHashed email/phone/name + fbp / fbc / hashed external_id + aggregate geo + IP/UA. Maximum match.
denied, unknown / nullnothing, or a countNot sent (skip reason consent_not_granted) — unless the destination's Count the not-consented option is on (GA4, Meta, TikTok): then a count. Google Ads and ChatGPT Ads never. No answer is not consent.

Count the not-consented is an option of each GA4, Meta and TikTok destination (its settings in the panel; off for a new destination; a GA4 destination connected before the option keeps counting). A count: no PII, no click ID, no IP, no location — the event, its value and products, the page without its query, the user agent and a visitor id that changes every day (GA4: its client id); on Meta the LDU flag. It shows in the platform's totals, never in ROAS; GA4 does not model it.

One event id per event. The snippet gives the store's own pixel call the event id and records the id the call left with; every copy we send uses exactly that id — full or count, the Shopify webhook's copy of an order too — so the platform counts the event once. A consented purchase: order-<order key>; a not-consented one: a fresh id, never the order number. The destination health shows, per store, how many of your pixel's calls left with our id and how many with your own.

Exception: if your pixel's own script has already loaded and sent its call before snippet.js runs, that call leaves without our id and the platform may count it twice. This is usually the first page view of a page load; on a single-page site, the page changes of that load too. Placing the install code first in <head> keeps this rare.

What lands in Meta's user_data (match keys)

For a Meta CAPI forward, Tocadule assembles user_data from the event's own person (when your code put customer fields on it) over the resolved contact, + the visitor's stored browser identifiers + the request context. Match quality (EMQ) is a function of how many of these fields are present and correct.

Meta fieldSourceSent in
emContact email (SHA-256, lower-cased/trimmed)full only
phContact phone (digits-only, SHA-256)full only
fn / lnContact first / last name (SHA-256)full only
geContact gender: f / m only from an explicit value (f, m, female, male, kadın, erkek, k, e), else omitted (SHA-256)full only
dbContact date of birth as YYYYMMDD from a full date (ISO, DD.MM.YYYY, DD/MM/YYYY), else omitted (SHA-256)full only
fbcReal _fbc cookie the snippet captured, else reconstructed from stored fbclid + click time (ms)full only
fbp_fbp browser ID (read from the pixel's cookie or baked by the snippet)full only
external_idSHA-256 of the visitor's anonymous_id (the raw id never leaves); modeled: a daily-rotating id; an event with no other key: Tocadule's keyed id from the order (or the event)full, modeled
country / st / zp / ctThe person's declared address as declared (the event's own, else the contact's); with none, the event's IP location whole (ISO country, region, postal, city) — never parts of two — SHA-256full only
client_ip_addressReal client IP (from the request)full only
client_user_agentRequest User-Agentalways

Notes grounded in the adapter:

  • Everything personal is hashed with SHA-256 before it leaves; Tocadule never sends a raw email, phone, or name.
  • Meta needs at least one match key: em, ph, external_id, fbc, fbp, or the IP and the user agent together (the user agent alone is not a key). An event with none of them — typically a Shopify order of a buyer who refused ads — gets Tocadule's keyed id as external_id, so Meta accepts and counts it without tying it to anyone.
  • Product ids: content_ids / contents come from the event's items. Shopify orders get items from their order lines, so purchases from the Shopify app carry them too.
  • The address is one source, as it came: the person's declared address (a part it lacks — the country too — stays missing), else the event's location resolved from the real client IP by MaxMind (offline), whole. Contact location is declared-only (identify traits, a popup field, CSV, the Shopify address).

Dedup with your browser pixel

If the snippet is also present alongside your own Meta pixel, it injects the same event_id into the pixel's eventID and sends it on the CAPI copy, so Meta dedups the two into one event (web_event_id → source_event_id → row id, in that order). You keep your pixel; the server-side send fills the gap when the browser pixel is blocked, deduped rather than double-counted. You never set dedup IDs yourself — anonymous_id handles browser-side dedup and source_event_id handles external systems.

What lands in Google Ads

Google Ads receives conversions only: each event you forward must be mapped to a conversion action of type Import from clicks in your Google Ads account. Tocadule sends one identifier from this list, strongest first, plus everything else your consent allows:

Sent asWhat it usesNeeds
gclidThe Google click IDfull consent
gbraid / wbraidThe iOS click ID, when gclid was removed (common on Safari)full consent
enhancedHashed email / phone / name / address of the contact, with no click IDfull consent
deviceGoogle's landing context (g_session_attrs) and the landing IP addressfull consent
  • Click IDs and the landing device (browser and IP) come from the visitor's most recent Google click, stored server-side, so a conversion on a later page or another device still carries them.
  • No IP address is sent for visitors in the EEA, the UK or Switzerland.
  • Only events with granted ad consent are uploaded. Under modeled (denied or no answer) nothing is sent, because Google Ads accepts no upload without an identifier.

Uploads are held, then checked

Google rejects a conversion whose click is less than 6 hours old, and it reports the outcome of an upload later, not in the response. So Google Ads forwards do not go out the moment the event arrives:

  1. The conversion waits until its click is 6 hours old (a conversion with no click ID goes in the next run).
  2. Every 15 minutes, waiting conversions are uploaded in batches.
  3. About 30 minutes later, Tocadule asks Google for the result: confirmed, partly rejected or rejected. A failed upload is retried up to 3 times.
  4. If Google has not answered after 26 hours, the conversion is closed as no result. A click older than 90 days is never uploaded.

The destination's Overview tab shows where each conversion of the last 7 days stands, when the next upload goes out, and Google's latest error messages.

What lands in ChatGPT Ads

ChatGPT Ads (OpenAI) receives events through its Conversions API. To connect, paste two values from ChatGPT Ads Manager → Conversions: the data source's Pixel ID and a Conversions API key (not the Ads API key).

⚠️

Events alone are not conversions. In Ads Manager, create a conversion event from this data source (for example Purchase) and attach it to your campaigns. Until then, events arrive but no campaign reports them. Only a standard event can be a campaign's optimization goal; custom events are reported only.

Our eventSent as
purchaseorder_created
checkout_startedcheckout_started
add_to_cartitems_added
product_viewcontents_viewed
anything else you adda custom event under its own name, or any standard event you pick

page_view is not forwarded by default — add it if a campaign needs it.

TreatmentWhat is sent
fullThe ad click (oppref), the OpenAI pixel's browser id (obref), hashed email / phone / name, a hashed external_id, aggregate geo, IP and user agent
modeledNothing. ChatGPT Ads has no consent-denied mode, so a visitor who refused or did not answer is not sent (the same rule as Google Ads)
  • oppref is the click id ChatGPT adds to an ad's landing URL. OpenAI's API does not capture it; the snippet keeps it for 30 days (the same lifetime OpenAI's own pixel uses), so a purchase days later — or a webhook order with no browser at all — still carries the click. Visits that arrive with it are classified as traffic_source: paid, traffic_platform: chatgpt.
  • Amounts are sent in the currency's minor unit (₺129.99 → 12999).
  • Events older than 7 days are not sent; ChatGPT Ads rejects them.
  • Dedup with the OpenAI pixel: if you run OpenAI's pixel (oaiq), the snippet gives its measure calls the same event id our server copy carries. OpenAI keeps whichever copy arrives first and drops the other.
  • Test fire checks a full test purchase field by field without saving it, then delivers one test page view to prove the connection. Neither is counted as a conversion unless you made page views one.

Cancellations and refunds

A purchase_cancelled (how it arrives) is forwarded only where the platform can take a reversal:

DestinationWhat happens
GA4Sent as a refund — transaction_id = the order id, value = the reversed amount, currency. GA4 takes it off that transaction's revenue. On by default for GA4 destinations that forward purchase; remove the rule in the destination's mapping list if you don't want it.
Google AdsNot sent yet. Removing or restating a conversion needs Google Ads' conversion adjustments, which Tocadule doesn't upload today.
Meta, TikTok, ChatGPT AdsNot sent — their event APIs have no refund or cancellation event.

Revenue inside Tocadule (Analytics, Home, Toca) nets the reversal either way.

Why identifying shoppers matters most

The single biggest lever on match quality is a hashed email on the forward. It only ships in full mode (granted ad consent), and it only exists once the event's browser is linked to a contact. The worker reads it from the contact, never from the event.

Each event is forwarded once, when it happens:

  • Before the shopper is identified, their events go with the browser ids (fbp / fbc, our external_id, IP + UA): a weaker match.
  • After an identity event links the browser, their next events also carry the contact's hashed email / phone / name.

So identify shoppers as early as you can, with identity events only:

  • ONE identify(email) line in your common template for logged-in shoppers (standard: login, every logged-in page, a new browser), and identify at sign-up with the boxes ticked;
  • identify(email) on the order page for every buyer, right before purchase (one request: the purchase belongs to that contact), exactly the event ad platforms optimise toward.

Do not put the email on browsing events (product_view, checkout_started, …) when you call identify: it would not add anything the contact doesn't already give the forward. (An email on an event is that event's ad match only, never stored.)

identify is never forwarded, to any platform (a returning shopper logging in is not a new lead). Map your sign-up event (sign_up, signup_confirmed, lead) to Lead / CompleteRegistration instead.

The purchase, verbatim

Values sit in backticks, so a quote in a value never breaks the script; a token your page leaves unfilled (still {…}) is no value, and a missing required field shows as Eksik in the Data centre.

<script>
  // purchase: on your order confirmation page. Replace each {…} with your platform's token.
  var items = [];
  // inside your platform's product 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.identify(`{email}`);
  tocadule.track('purchase', { order_id: `{orderId}`, total: `{total}`, subtotal: `{subtotal}`,
    shipping: `{shipping}`, tax: `{tax}`, discount: `{discount}`, coupon: `{coupon}`,
    currency: `{currency}`, items: items });
</script>

A buyer who refused tracking is never identified on this door: the purchase is counted with the day's hash and is not sent to ad platforms (a count only, to a destination that counts the not-consented, with no personal data).

The cart is deliberately PII-free

tocadule.cart(...) carries only cart contents — never an email. It rides on the visitor's anonymous_id and resolves to the contact through the same identity_map join once an identity event links them. Keep it lean.

<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.

Custom event names

Any event name is accepted — you are not limited to the standard set. An unknown name is stored and appears in your dashboard exactly like a standard event (it shows up in Events / analytics under the name you sent, and in a contact's timeline once linked).

For forwarding, a custom name still needs an exact rule in a destination's mapping. When a rule's meta_name is set, it forwards under that Meta standard name (getting Meta's algorithm preference); when it's left null, the event is forwarded to Meta as a Custom event under your name verbatim — still measured and retargetable, just without standard-event optimisation.

Measuring match quality (Meta EMQ)

EMQ (Event Match Quality) is Meta's 0–10 score of how well your CAPI events match real accounts. Meta exposes it as a rolling 24–48h window with no history, so Tocadule snapshots it daily (per event name) and captures a day-0 baseline the moment a Meta destination is connected — the only "before Tocadule" reference you'll ever get, since it can't be backfilled. Send warnings Meta returns alongside a successful send are recorded too.

To move the score up: get a granted ad consent so full mode unlocks the hashed email/phone/name, and identify shoppers early (identify on logged-in pages, identify right before purchase) so their events resolve to a contact. IP + UA alone lands around 3/10; adding email, fbp, and fbc is what pushes it higher.

TikTok has no public match-quality API and GA4 has no EMQ concept (its health story is reconciliation), so the EMQ dashboard is Meta-only. The identity you attach still benefits the TikTok and GA4 forwards — richer match keys help every destination.