Lumail.ioLumail.io
DocsBlogChangelog

Getting Started

  • Introduction
  • Tutorials
  • API Reference
  • Integrations
  • Features
  • Workflows

Tutorials

  • Create an API Token
  • Build a V0 Capture Page
  • Dynamic Promo Codes with Webhooks

API Reference

  • API Tokens
  • Rate Limits
  • POSTSend Transactional Email
  • POSTEmail Verification API
  • POSTCreate Subscriber
  • GETGet Subscriber
  • PATCHUpdate Subscriber
  • DELETEDelete Subscriber
  • POSTAdd Tags to Subscriber
  • DELETERemove Tags from Subscriber
  • POSTTrack Event
  • GETGet Subscriber Events
  • GETGet All Tags
  • POSTCreate a Tag
  • Send Email in HTML
  • Send Email in Markdown
  • Send Email in Tiptap

Integrations

  • ClickFunnels Integration
  • SystemIO Integration

Features

  • Variables
  • Subscriber Events
  • Revenue Tracking
  • Email Deliverability Score
  • Email Engagement Score
  • Content Deliverability Checker

Workflows

  • Wait Step
  • Email Step
  • Action Step
  • Webhook Step

domains

  • Email Domains
  • Web Domains

Revenue Tracking

Track purchases and revenue from your subscribers

Lumail allows you to track purchase activity and revenue associated with your subscribers. This enables you to:

  • Calculate subscriber lifetime value (LTV)
  • Segment subscribers by purchase behavior
  • Measure ROI of your email campaigns
  • Create targeting based on purchase history
  • Build automation workflows triggered by purchases

How Revenue Tracking Works

Lumail tracks revenue by recording payment events against individual subscribers. Each payment event increases the subscriber's revenue counter, providing a running total of their lifetime value.

These payment events must be manually tracked through the Events API, allowing you to integrate with your existing payment system or e-commerce platform.

Setting Up Revenue Tracking

To track revenue for your subscribers, you'll need to send payment events to Lumail when purchases occur. Here's how to set it up:

1. Implement Event Tracking in Your Payment System

When a customer makes a purchase, you'll need to:

  1. Identify the subscriber by email address
  2. Record the purchase amount and details
  3. Send a SUBSCRIBER_PAYMENT event to Lumail

2. Send Payment Events to the API

Use the Events API to send payment information:

const response = await fetch("https://lumail.io/api/v1/events", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    eventType: "SUBSCRIBER_PAYMENT",
    subscriber: "customer@example.com",
    data: {
      amount: 49.99,
      product: "Premium Subscription",
    },
  }),
});

Required Payment Data Fields

FieldTypeDescription
amountnumberThe payment amount (required)
productstringName of the product purchased (required)

3. Track Refunds (Optional)

If you process refunds, you should also track these using the SUBSCRIBER_REFUND event:

const response = await fetch("https://lumail.io/api/v1/events", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    eventType: "SUBSCRIBER_REFUND",
    subscriber: "customer@example.com",
    data: {
      amount: 49.99,
      product: "Premium Subscription",
    },
  }),
});

4. View Revenue Data

Once you've implemented revenue tracking, you can:

  • See payment events in the subscriber timeline
  • View total revenue per subscriber in the subscribers list
  • Use revenue data for segmentation
  • Create reports based on revenue metrics

Integration Examples

E-commerce Integration

If you run an e-commerce store, you can integrate revenue tracking on your order confirmation page:

// Example code to run after successful checkout
async function trackOrderInLumail(order) {
  await fetch("https://lumail.io/api/v1/events", {
    method: "POST",
    headers: {
      Authorization: "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      eventType: "SUBSCRIBER_PAYMENT",
      subscriber: order.customerEmail,
      data: {
        amount: order.total,
        product: order.items.map((item) => item.name).join(", "),
      },
    }),
  });
}

Subscription System Integration

For subscription businesses, track recurring payments:

// Example webhook handler for subscription payment events
app.post("/webhook/payment-succeeded", async (req, res) => {
  const event = req.body;

  // Track the payment in Lumail
  try {
    await fetch("https://lumail.io/api/v1/events", {
      method: "POST",
      headers: {
        Authorization: "Bearer YOUR_API_TOKEN",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        eventType: "SUBSCRIBER_PAYMENT",
        subscriber: event.customer.email,
        data: {
          amount: event.amount / 100, // Convert from cents
          product: event.product.name,
        },
      }),
    });

    res.status(200).send("Event processed");
  } catch (error) {
    console.error("Error tracking payment:", error);
    res.status(500).send("Error processing event");
  }
});

Best Practices

  1. Be Consistent: Use the same format for all payment tracking
  2. Track Immediately: Send payment events as soon as the transaction is confirmed
  3. Include Product Info: Add descriptive product names to help with analysis
  4. Track Refunds: Always record refunds to keep revenue data accurate
  5. Test First: Verify your integration with test purchases before full deployment

Related Documentation

  • Subscriber Events Reference - Complete guide to all event types
  • Track Events API - Technical details for sending events
  • Get Subscriber Events API - Retrieve payment event history
  • Subscribers API - View and manage subscriber data
  • ClickFunnels Integration - Track order events automatically
Subscriber EventsEmail Deliverability Score

On This Page

How Revenue Tracking WorksSetting Up Revenue Tracking1. Implement Event Tracking in Your Payment System2. Send Payment Events to the APIRequired Payment Data Fields3. Track Refunds (Optional)4. View Revenue DataIntegration ExamplesE-commerce IntegrationSubscription System IntegrationBest PracticesRelated Documentation

Lumail.io

Create and send e-mail without paying thousands of dollars

Product

BlogDocumentationChangelogDashboard

Company

AboutAccount

Legal

TermsPrivacy

8 The Green STE B, Dover Delaware 19901, United States

© 2025 Codelynx, LLC. All rights reserved.

Sign in