لم يُكتب وصف هذه العملية بالعربية بعد، فأوصافها بالإنجليزية.
Track events
/ store/ v1/ analytics/ events- يدعم Idempotency-Key
Record what a shopper did on a headless storefront, for the store's conversion funnel: page_view, product_view, add_to_cart, checkout_started, checkout_completed. Send events in batches (up to 50) with anonymous visitor and session IDs. Bots, shoppers who opted out (DNT: 1, Sec-GPC: 1, consent: false) and events older than a day are discarded, not refused. Limited to 300 batches per minute per client address.
الترويسات
Idempotency-Keystringأرسل المفتاح نفسه لإعادة المحاولة بأمان: تُعاد الإجابة الأولى لمدة ٢٤ ساعة.
shop-api-versionYYYY-MMالإصدار الذي تُكتب به الإجابة. بدونه يُستخدم الإصدار المثبّت لتطبيقك، وإلا الأحدث.
الجسم
visitor_idstringمطلوبA random UUID the storefront keeps per browser (a long-lived first-party cookie or local storage). Never a customer ID, email or anything else that names a person.
session_idstringمطلوبA random UUID per visit, renewed after 30 minutes without activity.
eventsarray of objectsمطلوب1–50 events, oldest first.
consentboolean · أو nullThe shopper's answer on the storefront's consent banner, if it has one:
falserecords nothing.DNT: 1andSec-GPC: 1request headers are honoured the same way.landingobject · أو nullThe visit's landing page and referrer: send them with the visit's first batch, so its traffic source and campaign are known.
ما يُرجعه
202 Queued.
الأخطاء
- 401
unauthenticatedMissing or invalid publishable key. - 422
validation_failedInvalid batch. - 429
rate_limitedToo many batches.