Getting started
Track checkouts in your ads
Your Meta, Google and TikTok pixels see every checkout step and purchase, in the browser and from Cartirra's server, counted once.
If you advertise on Meta (Facebook and Instagram), Google or TikTok, your ads measure results by the purchases your pixels see. The Cartirra checkout tells them about each step, just as a checkout on your own site would.
What fires, and when
| Step | GA4 / Google Tag Manager | Meta | TikTok |
|---|---|---|---|
| The checkout opens with the cart | begin_checkout | InitiateCheckout | InitiateCheckout |
| The shopper chooses delivery, pickup or dine-in | add_shipping_info | — | — |
| The shopper chooses how to pay | add_payment_info | AddPaymentInfo | AddPaymentInfo |
| The payment succeeds | purchase | Purchase | CompletePayment |
Each step carries the value, the currency (NGN) and the items: id (your line's sku, or line-1, line-2…), name, quantity and price. purchase also carries transaction_id, the Cartirra order id (ord_…). Test-mode checkouts add cartirra_test: true, so you can filter them out.
Cartirra Popup: your page's pixels fire
When you open Cartirra Popup with cartirra.js, the steps fire on your page, through the pixels you already have:
fbq(Meta Pixel),gtag(Google tag) andttq(TikTok Pixel), each only if it's on the page;window.dataLayer, for Google Tag Manager:{ event: 'purchase', ecommerce: { … } }, after clearing the previousecommerce, as Google recommends.
Keep your pixels installed on the page that opens the checkout. Cartirra doesn't load any pixel on your page.
To send the steps somewhere else, use onEvent:
Cartirra.open({
publicKey: 'pk_live_…',
clientSecret,
onEvent(event) {
// { name: 'purchase', eventId: 'ord_…', value: 5000, currency: 'NGN', items: [...], test: false }
myAnalytics.track(event.name, event)
},
})
Cartirra Redirect: connect your pixels in the dashboard
Cartirra Redirect's checkout page isn't on your site, so it can't use your page's pixels. Connect them in Checkout → Ad tracking: your Meta pixel ID, your GA4 measurement ID (with an optional Google Ads conversion ID and label) and your TikTok pixel code. The checkout page loads those pixels and fires the same steps.
When Cartirra.open falls back to Cartirra Redirect, or you call Cartirra.redirect, the shopper's click IDs (fbclid, gclid, ttclid), UTM tags and ad cookies (_fbp, _fbc, _ga, _ttp) go with them. That way purchases still match the ad they clicked.
Server events: purchases ad blockers can't stop
Ad blockers and privacy settings stop many browser pixels. Turn on Send purchases from our server too for a platform, and Cartirra sends each paid order to that platform's server-side API:
| Platform | API | What you need |
|---|---|---|
| Meta | Conversions API | A Conversions API access token (Events Manager → your pixel → Settings) |
| GA4 Measurement Protocol | A Measurement Protocol API secret (Admin → Data streams → your stream) | |
| TikTok | Events API | An Events API access token (Events Manager → your pixel → Settings) |
The server event uses the order id as its event ID, the same ID as the browser's purchase, so each platform counts the purchase once.
To match a purchase to an ad, Cartirra sends:
- the shopper's email and phone, SHA-256 hashed after normalising, never in plain text;
- the ad cookies and click IDs the checkout found on your page;
- the shopper's IP address and browser.
Before server events turn on, you confirm that your privacy policy covers sharing purchase events with ad platforms. Nothing is sent about a shopper who has stopped sharing their details with you.
Each event is retried for about 30 minutes if a platform is down. Recent server events, on the same page, shows every event sent and each platform's answer.
Opening sessions from your server
The checkout reads click IDs and cookies on the page that opens it. If you know more, for example a gclid you saved when the shopper landed, pass it when you create the session. The shopper's own browser fills in anything you leave out.
curl https://api.cartirra.com/v1/checkout-sessions \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"lines": [{ "name": "Suya platter", "quantity": 2, "sku": "SUYA-1", "unit_price": { "amount": "2500", "currency": "NGN" } }],
"attribution": { "gclid": "Cj0KCQ…", "utm_source": "google", "utm_campaign": "october" }
}'
attribution takes fbp, fbc, fbclid, ga_client_id, gclid, ttp, ttclid, utm_source, utm_medium, utm_campaign, utm_term, utm_content, landing_url, ip and user_agent. The first value given for each field is kept.
Testing
- Meta and TikTok: add the test event code from Events Manager's Test events tab, then press Send test event. It shows there within seconds.
- Google: Send test event checks the event with GA4's validation server and shows any problem it finds.
- Test-mode checkouts send nothing from the server unless you turn on Send test-mode checkouts to the test tools. Then they go to Meta's and TikTok's test tools and to GA4 DebugView, never to your live reports.