Tugus Docs

E-Commerce Funnel

The full conversion funnel with all stages, code examples, and the properties reference.

The complete conversion funnel with all stages. Send these events in the order they occur on your website — Tugus automatically maps them to each platform's schema (Meta CAPI, GA4 items, TikTok contents, Klaviyo items).

The examples below use the browser SDK: tugus.track(name, payload) sends the payload object as the event's data automatically. For server-to-server calls you build the envelope yourself — the same fields go inside a nested data object (see HTTP API and the Payload Reference).

view_item_list

Category page or search result list displayed.

tugus.track('view_item_list', {
  item_list_id:   'cat_42',
  item_list_name: 'Sneaker',
  contents: [
    { id: 'SKU-12345', name: 'Sneaker X Pro', price: 89.90 },
    { id: 'SKU-12346', name: 'Sneaker Y Lite', price: 59.90 },
  ],
})

view_content

Product detail page (PDP) opened.

tugus.track('view_content', {
  content_id:       'SKU-12345',
  content_name:     'Sneaker X Pro',
  content_category: 'Sneaker',
  content_type:     'product',
  value:            89.90,
  currency:         'EUR',
  brand:            'Acme',
})

add_to_cart

tugus.track('add_to_cart', {
  content_id:   'SKU-12345',
  content_name: 'Sneaker X Pro',
  value:        89.90,
  currency:     'EUR',
  quantity:     1,
})

view_cart

Cart page opened — on JTL: /Warenkorb, on Shopify: /cart.

tugus.track('view_cart', {
  value:     179.80,
  currency:  'EUR',
  num_items: 2,
  contents: [
    { id: 'SKU-12345', quantity: 1, price: 89.90 },
    { id: 'SKU-67890', quantity: 1, price: 89.90 },
  ],
})

initiate_checkout

Checkout entry — the login or register step.

tugus.track('initiate_checkout', {
  value:     179.80,
  currency:  'EUR',
  num_items: 2,
  contents: [
    { id: 'SKU-12345', quantity: 1, price: 89.90 },
    { id: 'SKU-67890', quantity: 1, price: 89.90 },
  ],
})

add_shipping_info

Shipping address + shipping method entered.

tugus.track('add_shipping_info', {
  value:         179.80,
  currency:      'EUR',
  shipping_tier: 'standard',
  contents: [/* ... */],
})

add_payment_info

Payment method selected.

tugus.track('add_payment_info', {
  value:        179.80,
  currency:     'EUR',
  payment_type: 'credit_card',
  contents: [/* ... */],
})

purchase

Order completed. Required: value + currency (enforced server-side for purchase/refund). order_id is strongly recommended for deduplication.

tugus.track('purchase', {
  order_id:  'ORD-2024-001',
  value:     179.80,
  currency:  'EUR',
  shipping:  4.90,
  tax:       28.65,
  coupon:    'BLACKFRIDAY',
  contents: [
    { id: 'SKU-12345', name: 'Sneaker X Pro', quantity: 1, price: 89.90 },
    { id: 'SKU-67890', name: 'Socken Pack',   quantity: 1, price: 89.90 },
  ],
  user: {
    email:      'kunde@example.com',
    phone:      '+4917612345678',
    first_name: 'Max',
    last_name:  'Mustermann',
    zip:        '80331',
    country:    'DE',
  },
})

purchase — server-to-server

The same event over raw HTTP. Note the nested data object:

{
  "event":    "purchase",
  "event_id": "purchase_ORD-2024-001",
  "data": {
    "order_id": "ORD-2024-001",
    "value":    179.80,
    "currency": "EUR",
    "shipping": 4.90,
    "tax":      28.65,
    "coupon":   "BLACKFRIDAY",
    "contents": [
      { "id": "SKU-12345", "name": "Sneaker X Pro", "quantity": 1, "price": 89.90 },
      { "id": "SKU-67890", "name": "Socken Pack",   "quantity": 1, "price": 89.90 }
    ]
  },
  "user": { "email": "kunde@example.com", "country": "DE" }
}

refund

Refund issued. Send order_id, plus optional items for partial returns.

tugus.track('refund', {
  order_id: 'ORD-2024-001',
  value:    89.90,
  currency: 'EUR',
  contents: [
    { id: 'SKU-67890', quantity: 1, price: 89.90 },
  ],
})

add_to_wishlist / remove_from_cart

Work the same way as add_to_cart:

tugus.track('add_to_wishlist', {
  content_id: 'SKU-12345', value: 89.90, currency: 'EUR',
})

tugus.track('remove_from_cart', {
  content_id: 'SKU-12345', quantity: 1, value: 89.90, currency: 'EUR',
})

Deduplication: Tugus generates a deterministic event_id from order_id + event_name. For purchase and refund, events sent twice are therefore protected against duplicates on both the browser and server side.

Properties reference

An overview of all available fields per event. With the browser SDK these are the keys of the tugus.track() payload; over HTTP they live inside the data object.

FieldTypeRequiredDescription
valuefloatRequired¹Total monetary value. Required for purchase/refund.
currencystringRequired¹ISO 4217, 3 letters (e.g. EUR). Required for purchase/refund. Auto-uppercased.
order_idstringRecommendedOrder/transaction ID — drives dedup for purchase/refund.
content_idstringOptionalSingle-product SKU.
content_namestringOptionalProduct name.
content_categorystringOptionalCategory name.
content_typestringOptionalDefault product; also home_listing, travel.
brandstringOptionalBrand name.
quantityintOptionalSingle-item quantity.
num_itemsintOptionalTotal items. Auto-calculated from contents.
contentsarrayOptionalMulti-product cart, see below.
shippingfloatOptionalShipping cost.
taxfloatOptionalTax portion.
couponstringOptionalCoupon code.
shipping_tierstringOptionalShipping method for add_shipping_info.
payment_typestringOptionalPayment method for add_payment_info.
item_list_idstringOptionalCategory/list ID for view_item_list.
item_list_namestringOptionalCategory/list name.
promotion_idstringOptionalFor view_promotion/select_promotion.
promotion_namestringOptionalPromotion name.

contents[] — item schema

FieldTypeRequiredDescription
idstringRequiredProduct SKU / identifier.
namestringOptionalProduct name.
pricefloatOptionalUnit price (not total price).
quantityintOptionalQuantity (default: 1).
categorystringOptionalCategory name.
brandstringOptionalBrand name.
variantstringOptionalVariant (e.g. color, size).
couponstringOptionalItem-level coupon.
discountfloatOptionalItem-level discount.

¹ value and currency are optional for funnel events (view_content, add_to_cart, …) but required for purchase and refund — the collect endpoint rejects those with 422 if either is missing.