BETA
Docs
Event reference

Track the events that prove what happened.

Use stable, lowercase, dot-separated names. Properties should be JSON-serializable and should keep the same shape every time an event fires.

The listed fields are the recommended tracking contract. Ingestion accepts other non-empty names; diagnostics flags missing properties for supported event types. Keep credentials and personal information out of event payloads, URLs, titles, and user IDs.

Ecommerce events

page.view

Initial page load and SPA route changes.

pathtitle
window.sarge("track", "page.view", {
  path: window.location.pathname,
  title: document.title
});

product.viewed

Product detail view, quick view, or product card inspection.

product_id
window.sarge("track", "product.viewed", {
  product_id: "field-flask",
  product_name: "Field Flask",
  price: 42,
  currency: "USD"
});

cart.added

A product is successfully added to cart.

product_idprice
window.sarge("track", "cart.added", {
  product_id: "field-flask",
  product_name: "Field Flask",
  price: 42,
  currency: "USD",
  cart_size: 1
});

checkout.started

The customer starts checkout.

valuecurrency
window.sarge("track", "checkout.started", {
  value: 84,
  currency: "USD",
  cart_size: 2
});

purchase.completed

Payment succeeds and an order is created.

order_idvaluecurrency
window.sarge("track", "purchase.completed", {
  order_id: "order_123",
  value: 84,
  currency: "USD",
  item_count: 2,
  products: ["field-flask", "map-wax"]
});

Watchdog events

These are emitted automatically when Sarge observes common third-party marketing APIs after the pixel loads. Server-side vendor calls can use the same event names with `transport: "server"`, an `upstream` response summary, and an optional `implementation.note` for AI reviewer context.

meta.pixel.fire

Observed from `fbq(...)`, or reported by a server Meta API call.

{
  vendor: "meta",
  command: "track",
  event_name: "Purchase",
  payload: { value: 84, currency: "USD" }
}

google.tag.fire

Observed from `gtag(...)`, or reported by a server Google API call.

{
  vendor: "google",
  command: "event",
  event_name: "purchase",
  payload: { transaction_id: "order_123", value: 84 }
}

data_layer.push

Observed from `dataLayer.push(...)`

{
  vendor: "google",
  payload: {
    event: "purchase",
    ecommerce: { value: 84, currency: "USD" }
  }
}