NevarMail

Analytics

Track email delivery metrics, engagement events, and generate reports.

NevarMail provides comprehensive analytics for monitoring email delivery, opens, clicks, bounces, and other engagement events.

Summary

Get a high-level overview of your email performance for a given date range:

GET /api/analytics/summary?from=2026-03-01T00:00:00Z&to=2026-03-22T23:59:59Z
{
  "totalSent": 150,
  "totalDelivered": 145,
  "totalOpened": 50,
  "totalClicked": 12,
  "totalBounced": 3,
  "deliveryRate": 96.67,
  "openRate": 34.48,
  "clickRate": 24.0,
  "bounceRate": 2.0
}

Query parameters

All analytics endpoints accept optional date range parameters. If omitted, they default to the last 30 days.

ParameterTypeDefaultDescription
fromstring (ISO 8601)30 days agoStart of date range
tostring (ISO 8601)NowEnd of date range

Delivery report

Get daily delivery statistics and a breakdown by provider:

GET /api/analytics/delivery-report
{
  "dailyStats": [
    { "date": "2026-03-20", "sent": 10, "delivered": 9, "bounced": 1 },
    { "date": "2026-03-21", "sent": 15, "delivered": 15, "bounced": 0 }
  ],
  "providerBreakdown": [
    { "provider": "sendgrid", "sent": 100, "delivered": 97, "bounced": 2 },
    { "provider": "mailgun", "sent": 50, "delivered": 48, "bounced": 1 }
  ]
}

Bounce report

Analyze bounce patterns to identify delivery issues:

GET /api/analytics/bounce-report
{
  "totalBounces": 5,
  "bouncesByReason": [
    { "reason": "invalid_address", "count": 3 },
    { "reason": "mailbox_full", "count": 2 }
  ],
  "bouncesByProvider": [
    { "provider": "sendgrid", "count": 5 }
  ]
}

Per-email stats

Get the event timeline for a specific email:

GET /api/analytics/stats/:emailId
{
  "emailId": "550e8400-e29b-41d4-a716-446655440000",
  "events": [
    { "type": "sent", "timestamp": "2026-03-22T12:00:00.000Z", "metadata": null },
    { "type": "delivered", "timestamp": "2026-03-22T12:00:03.000Z", "metadata": null },
    { "type": "opened", "timestamp": "2026-03-22T12:00:10.000Z", "metadata": null },
    { "type": "clicked", "timestamp": "2026-03-22T12:01:30.000Z", "metadata": null }
  ]
}

Event types

EventDescription
sentEmail was accepted by the provider
deliveredEmail was delivered to the recipient's mailbox
openedRecipient opened the email
clickedRecipient clicked a link in the email
bouncedEmail bounced (see bounce report for reasons)

Track custom events

Manually record an analytics event for an email:

POST /api/analytics/track
{
  "emailId": "550e8400-e29b-41d4-a716-446655440000",
  "type": "clicked",
  "recipient": "user@example.com",
  "provider": "sendgrid",
  "url": "https://yourdomain.com/promo",
  "metadata": { "campaign": "spring-2026" }
}

Returns { "tracked": true } on success.

Key metrics explained

MetricFormula
Delivery Rate(delivered / sent) x 100
Open Rate(opened / delivered) x 100
Click Rate(clicked / opened) x 100
Bounce Rate(bounced / sent) x 100

On this page