How to send ecommerce events to Hardal

This is how you can send ecommerce events to Hardal.

Berkay Demirbas
1 min read
Hardal Guides

This is how you can send ecommerce events to Hardal. You can send any ecommerce event to Hardal by using hardal.track() function from your both client-side with cookieless pixel and server-side using server-to-server (S2S) endpoint.

Client-side ecommerce tracking

You can send a simple purchase event to Hardal.

hardal.track('purchase')

or you can send a purchase event with nested product data to Hardal.

hardal.track('purchase', {
  transaction_id: '1234567890',
  revenue: 1000,
  tax: 100,
  shipping: 100,
  discount: 100,
  currency: 'TRY',
  status: 'completed',
  items: [{
    id: 'SKU123',
    name: 'Product 1',
    price: 100,
  },
  {
    id: 'SKU456',
    name: 'Product 2',
    price: 100,
  }
  ]
})

You can send any event to Hardal by using hardal.track() function from your client-side.

Server to server ecommerce tracking

You can send any ecommerce event to Hardal by using our server-side endpoint.

//Example server-side payload

curl -X POST "https://<your-custom-signal-domain>/push/hardal" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "event",
    "payload": {
      "name": "purchase",
      "url": /thank-you",
      "title": "Purchase Event",
      "device_type": "mobile",
      "language": "en-US",
      "platform": "ios",
      "test": true,
      "timestamp": "2025-11-13T08:47:05.331Z",
      "transaction_id": "1234567890",
      "revenue": 1000,
      "tax": 100,
      "shipping": 100,
      "discount": 100,
      "currency": "TRY",
      "status": "completed",
      "items": [
        {
          "id": "SKU123",
          "name": "Product 1",
          "price": 100
        },
        {
          "id": "SKU456",
          "name": "Product 2",
          "price": 100
        }
      ]
    }
  }'

Ready to switch first-party and server-side measurement?

Join hundreds of companies using Hardal for better and faster data quality.