Ingesting events

Browser, server, and direct HTTP event collection.

All ingestion goes through the write-key API. The SDK is the easiest path, but you can also call the endpoints directly.

From the browser (SDK)

1import { init, page, track, identify } from "@pivolio/sdk";
2
3init({ writeKey: "YOUR_WRITE_KEY", apiUrl: "https://api.pivolio.com" });
4
5page(); // page view
6track("product_viewed", { product_id: "sku_1", price: 49.75 });
7identify({ user_id: "user_456", email: "jane@acme.com" });

The SDK captures UTMs, click IDs (gclid, fbclid, ttclid, …), and session context automatically, and retries failed sends.

Directly over HTTP

$curl https://api.pivolio.com/track \
> -H "X-Write-Key: YOUR_WRITE_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "event_name": "order_completed",
> "anonymous_id": "anon_abc",
> "properties": { "order_id": "ord_123", "revenue": 99.5, "currency": "USD" }
> }'

Standard events

Use standard event names (e.g. order_completed, lead_submitted, product_viewed) to get automatic destination mapping — any other name is treated as a custom event. See the API Reference for the full request shape and the StandardEventName values.