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:
| Call | Purpose |
|---|---|
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
- You call
tocadule.track('purchase', {...}). The snippet POSTs it to/events/track. - The event is stored (personal data stripped), its
anonymous_idis resolved to a contact viaidentity_map, and geo / IP / User-Agent are enriched onto it as consent allows. - Tocadule looks at your destinations. Each destination has an
events_to_forwardlist — 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. - 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:
| Lane | Field | Gates |
|---|---|---|
| Analytics / general | consent_state | Keeping 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. |
| Advertising | ad_consent | Whether 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_consent | Treatment | What is sent |
|---|---|---|
granted | full | Hashed email/phone/name + fbp / fbc / hashed external_id + aggregate geo + IP/UA. Maximum match. |
denied, unknown / null | nothing, or a count | Not 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 field | Source | Sent in |
|---|---|---|
em | Contact email (SHA-256, lower-cased/trimmed) | full only |
ph | Contact phone (digits-only, SHA-256) | full only |
fn / ln | Contact first / last name (SHA-256) | full only |
ge | Contact gender: f / m only from an explicit value (f, m, female, male, kadın, erkek, k, e), else omitted (SHA-256) | full only |
db | Contact date of birth as YYYYMMDD from a full date (ISO, DD.MM.YYYY, DD/MM/YYYY), else omitted (SHA-256) | full only |
fbc | Real _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_id | SHA-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 / ct | The 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-256 | full only |
client_ip_address | Real client IP (from the request) | full only |
client_user_agent | Request User-Agent | always |
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 asexternal_id, so Meta accepts and counts it without tying it to anyone. - Product ids:
content_ids/contentscome from the event'sitems. Shopify orders getitemsfrom 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 as | What it uses | Needs |
|---|---|---|
gclid | The Google click ID | full consent |
gbraid / wbraid | The iOS click ID, when gclid was removed (common on Safari) | full consent |
enhanced | Hashed email / phone / name / address of the contact, with no click ID | full consent |
device | Google's landing context (g_session_attrs) and the landing IP address | full 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:
- The conversion waits until its click is 6 hours old (a conversion with no click ID goes in the next run).
- Every 15 minutes, waiting conversions are uploaded in batches.
- About 30 minutes later, Tocadule asks Google for the result: confirmed, partly rejected or rejected. A failed upload is retried up to 3 times.
- 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 event | Sent as |
|---|---|
purchase | order_created |
checkout_started | checkout_started |
add_to_cart | items_added |
product_view | contents_viewed |
| anything else you add | a 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.
| Treatment | What is sent |
|---|---|
| full | The ad click (oppref), the OpenAI pixel's browser id (obref), hashed email / phone / name, a hashed external_id, aggregate geo, IP and user agent |
| modeled | Nothing. 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) |
opprefis 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 astraffic_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 itsmeasurecalls 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:
| Destination | What happens |
|---|---|
| GA4 | Sent 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 Ads | Not sent yet. Removing or restating a conversion needs Google Ads' conversion adjustments, which Tocadule doesn't upload today. |
| Meta, TikTok, ChatGPT Ads | Not 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, ourexternal_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), andidentifyat sign-up with the boxes ticked; identify(email)on the order page for every buyer, right beforepurchase(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.