Docs
Install the tracker, stream events, and recover abandoned shoppers with rule-based actions.
1 · Install the tracker
Drop this snippet in the <head> of every page on your storefront. Replace YOUR_SITE_KEY with the key shown on your site page.
<script async src="https://www.recartiq.com/api/public/script/YOUR_SITE_KEY"></script>The tracker is ~8 KB, loads asynchronously, persists a ac_vid visitor identifier in localStorage + cookie, and uses navigator.sendBeacon with a keepalive fetch fallback so events survive page unload.
2 · What gets tracked automatically
- pageview — on load and on SPA route changes (
history.pushStateis patched). - product_view — detected from JSON-LD
@type: Productorog:type=product. - add_to_cart — fires on clicks matching
[data-add-to-cart], buttons with text like Add to cart / Buy now, and network requests to/cart/add. - identify — a single capture-phase
submitlistener extractsinput[type=email]andinput[type=tel]from any form. Zero merchant configuration.
Need manual control? Call window.RecartIQ.identify() after your own flow:
// merchant-side manual identify call (optional — forms are auto-captured)
window.RecartIQ.identify({ email: "buyer@example.com", phone: "+15551234567" });3 · Send orders
When a checkout completes, POST to the order webhook from your server so RecartIQ can mark the visitor converted and compute uplift reports (exposed vs organic conversion rate).
// server-side, after checkout succeeds
await fetch("https://www.recartiq.com/api/public/order", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
siteKey: "YOUR_SITE_KEY",
visitorId: ac_visitor_id, // read from the "ac_vid" cookie on the order page
orderId: "ORDER-12345",
amountUsd: 129.99,
currency: "USD",
email: "buyer@example.com",
}),
});Idempotent on (siteKey, orderId) — safe to retry. No per-order fees; your plan is a flat monthly subscription.
4 · Rules & integrations
Open Rules and compose triggers (cart abandoned for N seconds, product viewed without purchase) with actions:
- generate_coupon — POST to your coupon endpoint with a random code
- send_email — via your Resend API key
- send_whatsapp — Twilio or Meta Cloud API
- webhook — raw POST to any URL
Configure the coupon endpoint + signing secret under your site integrations. Secrets are AES-256-GCM encrypted at rest.
5 · Coupon webhook payload
When a rule fires a generate_coupon action, we POST this to your endpoint:
{
"code": "ABAN-7F3K2Q",
"discountPercent": 10,
"email": "buyer@example.com",
"phone": "+15551234567",
"visitorId": "8a1f…",
"cartValue": 129.99,
"productId": "SKU-AEROLITE"
}Each request includes an x-recartiq-signature header containing hex(HMAC-SHA256(body, yourSigningSecret)). Verify it on your side before honoring the coupon.
6 · Rate limits & CORS
- /api/public/collect — 300 events/minute per (siteKey, ip)
- /api/public/order — 60 orders/minute per (siteKey, ip)
- CORS is restricted to the site's registered domain and its subdomains. Update the domain on the site detail page before moving to a new storefront.
Still need help?
Open an issue or reach out — we ship weekly and love feedback from early merchants.