GuidesTrack a Purchase

Track a Purchase

Track a confirmed purchase in Hardal with order and item data, then verify the stored event and Commerce report.

Track a purchase

Send the purchase event when an order is confirmed. Use the same purchase parameters across browser, mobile, and backend implementations; HTTP senders wrap them in payload.data as shown in API & Server-side Setup.

Pick where to send it

Choose one authoritative sender for the confirmed order. On a confirmation page, use hrd.track() after the tracker is available. For backend confirmation, follow Track Server-Confirmed Purchases; that flow does not depend on a confirmation page loading.

Send the event

Include the order's transaction_id, value, currency, and items. Replace every example value with data from the confirmed order.

hrd.track("purchase", {
  transaction_id: "ORD-20260615-7891",
  value: 214.98,
  currency: "USD",
  tax: 17.20,
  shipping: 5.99,
  items: [
    { item_id: "JKT-WIND-M", item_name: "StormShield Windbreaker", price: 79.99, quantity: 1 },
    { item_id: "SNK-URBAN-10", item_name: "UrbanGlide Sneakers", price: 134.99, quantity: 1 }
  ]
});

Match your funnel events

Use the same item_id and item_name in view_item, add_to_cart, and purchase so the event stream stays consistent.

Verify it

Place a test order and inspect the next collection request for eventName: "purchase" and the order values. Find the stored event in Engagement → Events, inspect its items and session, and check Commerce for the same tenant, source, period, and reporting currency.

Use one stable transaction_id and one sender for each order. Prevent duplicate sends in your application or tag. A shared transaction ID alone does not deduplicate submissions to Hardal.

Continue the analysis

Use product views, carts, and purchases for item-level performance. Use a checkout funnel for progression through a defined sequence. Overall orders and ordered funnel completions answer different questions.

Standard Events

See the full purchase and Item Object parameters.