Misar IO Docs

Tracking

Track email opens, clicks, custom events, and ecommerce purchases.

Tracking

MisarMail provides server-side event tracking for opens, clicks, and custom conversion events.

Open tracking

Open tracking is automatic for all sent emails. A 1×1 pixel is appended to the HTML body. Opens fire a GET request to:

GET https://api.misar.io/mail/track/open/:token

This endpoint requires no authentication and returns a 1×1 transparent GIF.

Apple Mail Privacy Protection pre-fetches tracking pixels. MisarMail accounts for this and does not count machine-opened pre-fetches as genuine opens.

Custom event tracking

Track conversions and custom actions from your application:

POST /v1/track/event

Required scope: send or write

{
  "email": "[email protected]",
  "event": "trial_started",
  "properties": {
    "plan": "pro",
    "source": "onboarding"
  },
  "timestamp": "2025-06-15T10:30:00Z"
}

Fields

| Field | Type | Required | Description | |-------|------|----------|-------------| | email | string | ✅ | Contact email | | event | string | ✅ | Event name (snake_case recommended) | | properties | object | — | Arbitrary key-value metadata | | timestamp | string | — | ISO 8601; defaults to now | | messageId | string | — | Link event to a specific send |

Response:

{ "success": true, "tracked": true }

Purchase tracking

Track ecommerce purchases for revenue attribution:

POST /v1/track/purchase
{
  "email": "[email protected]",
  "orderId": "order_1234",
  "revenue": 49.99,
  "currency": "USD",
  "items": [
    { "id": "prod_abc", "name": "Pro Plan", "price": 49.99, "quantity": 1 }
  ],
  "messageId": "msg_01ABCDEF"
}

messageId links the purchase back to the campaign or transactional email that drove the conversion.

Segment on events

Events tracked via the API automatically update contact engagement scores and can be used as segment conditions in the dashboard (Segments → New Segment → Event condition).

JavaScript snippet

For web tracking without a server round-trip, embed the tracking snippet on your site:

<script>
  window.MisarMail = { key: 'msk_YOUR_PUBLIC_KEY' };
</script>
<script src="https://cdn.misar.io/mail/track.js" async></script>

<script>
  // Track page view
  MisarMail.track('page_viewed', { url: window.location.href });

  // Identify user
  MisarMail.identify('[email protected]', { plan: 'pro' });
</script>

Use a public API key (scope: send) in client-side code. Never expose keys with write or contacts scope in the browser.