Skip to main content
POST
Send batched analytics events to track widget usage and conversion funnels. Max 50 events per batch. Tracking failures never block user flow.
On JavaScript, the @genlook/storefront SDK is the recommended integration: it calls this endpoint for you, along with the rest of the try-on flow.
With the SDK, funnel events are assembled, batched, and sent automatically; switch them off with tracking: "denied" when creating the client.

Request

array
required
Array of event objects. Each contains:
  • event (string, required): Event name (e.g. widget:button_click)
  • properties (object, optional): Custom properties
  • timestamp (string, required): ISO 8601 timestamp
  • $insert_id (string, required): Unique ID for deduplication
object
required
Shared context for all events in the batch. Required fields: anonymous_id (anon_*), session_id (sess_*), $pageview_id, widget_version (wv_*), widget_enabled, product_id and variant_id (both nullable), $screen_width, $screen_height (send 0 when there is no display), and $timezone.The page fields ($current_url, $pathname, $host, $viewport_width, $viewport_height, $raw_user_agent, $browser_language) are optional and nullable: a browser fills them all, a native app or a server has none of them, and an honest null is expected there. Never invent values for them.An integration field (optional string) labels where the batch came from, e.g. "sdk". Set it when you build batches yourself so your traffic can be told apart in analytics.
The Genlook SDK assembles and sends all of this for you, batching included. Build batches by hand only when you are not on JavaScript.

Event Types

Event names follow category:action format with snake_case. The names are part of the analytics contract, so send them exactly as listed.

Identifying a signed-in shopper

Two optional headers attach the batch to a known shopper:
  • X-Genlook-Customer-Id: platform customer id
  • X-Genlook-Customer-Email: customer email
The request body is identical whether or not you send them.

Authenticating

One endpoint serves every platform, and in most cases you send no credential at all: whatever sits between your code and Genlook adds one for you.
Your store API key is a server credential. It never belongs in an app binary, a page bundle, or any request a browser makes. The only key meant to be embedded is the publishable one, and it always starts with pk_.

Response

boolean
required
Whether the batch was processed.