page.view
Initial page load and SPA route changes.
pathtitle
window.sarge("track", "page.view", {
path: window.location.pathname,
title: document.title
}); Use stable, lowercase, dot-separated names. Properties should be JSON-serializable and should keep the same shape every time an event fires.
Initial page load and SPA route changes.
window.sarge("track", "page.view", {
path: window.location.pathname,
title: document.title
}); Product detail view, quick view, or product card inspection.
window.sarge("track", "product.viewed", {
product_id: "field-flask",
product_name: "Field Flask",
price: 42,
currency: "USD"
}); A product is successfully added to cart.
window.sarge("track", "cart.added", {
product_id: "field-flask",
product_name: "Field Flask",
price: 42,
currency: "USD",
cart_size: 1
}); The customer starts checkout.
window.sarge("track", "checkout.started", {
value: 84,
currency: "USD",
cart_size: 2
}); Payment succeeds and an order is created.
window.sarge("track", "purchase.completed", {
order_id: "order_123",
value: 84,
currency: "USD",
item_count: 2,
products: ["field-flask", "map-wax"]
}); These are emitted automatically when Sarge observes common third-party marketing APIs after the pixel loads.
Observed from `fbq(...)`
{
vendor: "meta",
command: "track",
event_name: "Purchase",
payload: { value: 84, currency: "USD" }
} Observed from `gtag(...)`
{
vendor: "google",
command: "event",
event_name: "purchase",
payload: { transaction_id: "order_123", value: 84 }
} Observed from `dataLayer.push(...)`
{
vendor: "google",
payload: {
event: "purchase",
ecommerce: { value: 84, currency: "USD" }
}
}