> Site index: https://usehardal.com/llms.txt
> Every content route also serves markdown at <url>.md

# How to send ecommerce events to Hardal

This is how you can send ecommerce events to Hardal.

Source: https://usehardal.com/how-to-send-ecommerce-events
Published: 2025-11-13
Updated: 2025-11-13
Author: Berkay Demirbas
Category: 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.

```js
hardal.track('purchase')
```

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

```js
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.

```json
//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
        }
      ]
    }
  }'
```
