Email Open Tracking Pixel Generator and Logger - n8n Workflow

Use this n8n workflow to generate and serve a 1x1 transparent tracking pixel. Monitor email opens efficiently using this customizable n8n templates solution.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Marketing Analysts needing granular email open tracking.
Developers building custom email verification or engagement tools.
Anyone seeking self-hosted alternatives to commercial tracking services.
Users looking for powerful n8n templates demonstrating webhook and binary response handling.

Overview

Understanding recipient engagement is vital for effective communication. This n8n workflow offers a clean, self-hosted solution for email open tracking by serving a transparent 1x1 pixel image via a dedicated HTTP endpoint. Unlike simple third-party trackers, this n8n templates solution gives you full control over the collected data.

The process begins when an email recipient opens the message, causing their client to request the tracking image URL. This request triggers the n8n node configured as a webhook. The workflow then rapidly converts pre-defined Base64 data into a binary PNG file. Utilizing flow control, the n8n workflow simultaneously delivers the image back to the client (to prevent broken image icons) and forwards the request metadata (such as recipient ID or timestamps) for logging or database storage. This effective use of parallel processing ensures reliable tracking without impacting the user experience. Implementing this powerful n8n trigger setup is a fundamental requirement for advanced email operations.

How it Works

This n8n workflow operates primarily based on an incoming HTTP request:


  1. Incoming Request: The process is initiated by the Webhook n8n trigger (labeled 'Request img'). When the pixel image is loaded in an email client, an HTTP GET request is sent to the specific webhook URL, often including query parameters (like ?id=1234) to identify the recipient.

  2. Define Pixel Data: The 'Create data pix' n8n node immediately prepares the payload. It defines a variable (data) containing the Base64 encoding of a 1x1 transparent PNG image.

  3. Convert to Binary: The 'Create img bin' n8n node converts the Base64 string into actual binary file data, setting the MIME type to image/png. This is critical for serving the image correctly via HTTP.

  4. Parallel Execution: From the binary conversion step, the n8n workflow splits into two paths:

Response Path: The 'Respond to Webhook' n8n node takes the binary data and serves it back to the client. Because the n8n node is configured to respond with binary data, the tracking pixel loads successfully, completing the request cycle instantly.
Logging Path: In parallel, the workflow moves to the 'Do anything to log' n8n node (a No-Op placeholder). This path is where you would connect database or logging n8n node integrations (e.g., Google Sheets, PostgreSQL, or Slack) to record the open event, IP address, and the captured id parameter. This asynchronous logging ensures fast image delivery.

Installation Guide


  1. Import: Copy the provided JSON code and import it into your n8n instance as a new n8n workflow.

  2. Webhook Setup: The 'Request img' n8n trigger is already configured with a specific webhook ID. Note down the full URL provided by your n8n instance (e.g., https://your.n8n.domain/webhook/db4880e7-2134-4994-94e5-a4a3aa120440).

  3. Embedding: Embed the URL into your HTML emails using the following structure, replacing the URL and the id value as needed:

<img src="https://<your-n8n-instance>/webhook/db4880e7-2134-4994-94e5-a4a3aa120440?id=RECIPIENT_ID" width="1" height="1" style="display:none;" alt="" />

  1. Logging Customization: Edit the 'Do anything to log' n8n node to perform your desired logging action (e.g., saving data to a database). Access the passed ID using expressions like {{$json["query"]["id"]}}.

  2. Activation: Ensure the n8n workflow is activated to start listening for requests.

Node Details

Request img (Webhook n8n Trigger):
Function: Serves as the primary n8n trigger, initiating the workflow when the image URL is requested.
Key Configuration: Configured to use a custom webhook ID and set to responseNode mode, allowing a subsequent n8n node to handle the HTTP response body.
Create data pix (Set n8n Node):
Function: Stores the Base64 encoded data representing the 1x1 transparent PNG image in a variable named data.
Key Configuration: assignments: Defines the Base64 string payload.
Create img bin (Convert to File n8n Node):
Function: Converts the Base64 string from the previous n8n node into a storable binary object, ready for serving.
Key Configuration: operation: toBinary; sourceProperty: data; mimeType: image/png.
Respond to Webhook (Respond to Webhook n8n Node):
Function: Sends the generated binary image back to the client immediately.
Key Configuration: respondWith: binary. This fulfills the request, serving the tracking pixel.
Do anything to log (No-Op n8n Node):
Function: A placeholder n8n node demonstrating the parallel path. Used for any logging, database insertion, or subsequent actions required after the tracking event is captured, decoupled from the response time.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by

Featured*