MailSlurp logo

guides

Email tracking pixels

Email Open Tracking with MailSlurp: Send tracking pixels to see if emails are opened, and receive open events via webhook or dashboard view.

See if emails are opened by sending tracking pixels. Receive open events via webhook or view which recipients opened an email in the MailSlurp dashboard.

When open tracking is actually useful

Open tracking is most useful when your team needs to answer one of these operational questions:

  • did a recipient engage with an onboarding, billing, or lifecycle message?
  • are campaigns or recurring streams getting opens after a template change?
  • should an automation or follow-up workflow trigger after an open event?
  • do we need extra evidence while troubleshooting message performance?

Open tracking is not a replacement for sender monitoring or campaign QA. It works best alongside Domain monitor, Campaign Probe, and Email deliverability.

Code example

import "jest";
import fetch from "node-fetch";
import { MailSlurp } from "mailslurp-client";

const timeout = 120000;
const mailslurp = new MailSlurp({ apiKey: process.env.apiKey });
jest.setTimeout(timeout);

describe("tracking controller", () => {
  it("can create a pixel and trigger seen", async () => {
    const pixel = await mailslurp.trackingController.createTrackingPixel({});
    expect(pixel.seen).toEqual(false);
    const res = await fetch(pixel.url);
    expect(res.ok).toBeTruthy();
    const pixel2 = await mailslurp.trackingController.getTrackingPixel(pixel.id);
    expect(pixel2.seen).toEqual(true);
  });
  it("can send email with tracking", async () => {
    const inbox1 = await mailslurp.createInbox();
    const inbox2 = await mailslurp.createInbox();
    const sent = await mailslurp.inboxController.sendEmailAndConfirm(inbox1.id!, {
      to: [inbox2.emailAddress!],
      body: "<html><body>Hello user</body></html>",
      addTrackingPixel: true,
    });
    expect(sent.pixelIds?.length).toEqual(1);
    const pixelId = sent.pixelIds?.[0];
    const pixel = await mailslurp.trackingController.getTrackingPixel(pixelId!);
    expect(pixel.seen).toEqual(false);
    const res = await fetch(pixel.url);
    expect(res.ok).toBeTruthy();
    const pixel2 = await mailslurp.trackingController.getTrackingPixel(pixel.id);
    expect(pixel2.seen).toEqual(true);
  });
});

What to pair with tracking pixels

Tracking pixels answer whether an open event happened. They do not answer every other reliability question around the message.

  • Use Campaign Probe when you also need broken-link, missing-image, and stream-level quality monitoring.
  • Use Domain monitor when the main risk is sender-auth drift.
  • Use Email audit when you need a one-shot pre-send review before launch.
  • Use Email webhooks when open events should trigger downstream systems.

Production rollout tips for tracking pixels

Before using open tracking in production: