ConverlayConverlay

Tracking Events

Use converlay.track(eventName, properties) to send events. The SDK automatically enriches each event with client ID, session, UTMs, click IDs, and consent state.

API signature

track() signature
converlay.track('event_name', {
  ecommerce: {
    transaction_id: 'ORD-123',
    value: 99.99,
    currency: 'USD',
    items: [
      {
        item_id: 'SKU-001',
        item_name: 'Classic Tee',
        price: 29.99,
        quantity: 2,
      },
    ],
  },
  userData: {
    email: 'customer@example.com',
  },
  pageType: 'product',
})

Standard event names

Use these event names for automatic mapping to GA4, Meta, and TikTok event types:

Event nameWhen to fire
page_viewPage load or client-side navigation
view_itemProduct detail page
view_item_listCollection or search results page
add_to_cartItem added to cart
remove_from_cartItem removed from cart
searchSearch query submitted
begin_checkoutCheckout started
add_payment_infoPayment info entered
add_shipping_infoShipping info entered
purchaseOrder completed

Custom events

You can use any string as an event name. Custom events will be forwarded as-is to destinations that support them.

TrackProperties fields

FieldTypeDescription
ecommerceEcommerceDataTransaction and item data
userDataUserDataCustomer PII for enhanced matching (hashed server-side)
pageTypestringPage type label (e.g., "product", "collection", "cart")
[key: string]unknownAny additional custom properties

Examples

View item

typescript
converlay.track('view_item', {
  ecommerce: {
    items: [{
      item_id: 'SKU-001',
      item_name: 'Classic Tee',
      item_variant: 'Blue / Large',
      price: 29.99,
      quantity: 1,
    }],
  },
})

Add to cart

typescript
converlay.track('add_to_cart', {
  ecommerce: {
    value: 29.99,
    currency: 'USD',
    items: [{
      item_id: 'SKU-001',
      item_name: 'Classic Tee',
      price: 29.99,
      quantity: 1,
    }],
  },
})

Purchase

typescript
converlay.track('purchase', {
  ecommerce: {
    transaction_id: 'ORD-5678',
    value: 129.99,
    currency: 'USD',
    items: [
      { item_id: 'SKU-001', item_name: 'Classic Tee', price: 29.99, quantity: 2 },
      { item_id: 'SKU-042', item_name: 'Hoodie', price: 70.01, quantity: 1 },
    ],
  },
  userData: {
    email: 'customer@example.com',
    phone: '+15551234567',
    firstName: 'Jane',
    lastName: 'Doe',
  },
})