Endpoint
How it works
When an email containing the tracking pixel is opened:- The email client requests the image from
https://your-server.com/t/{token}.gif - The server decodes the tracking token to extract email metadata
- The server checks for sender suppression signals (for Gmail proxy handling)
- The server records the open event in the database
- The server returns a 1x1 transparent GIF image
Parameters
Encoded tracking token containing email metadata. Generated using
encodeTrackingToken() from @email-tracker/shared.The token includes:email_id- Unique identifier for the emailuser_id- User who sent the emailrecipient- Recipient email addresssender_email- Sender email addresssent_at- ISO timestamp when email was sent
Request headers
The server automatically captures the following headers from the request:User-Agent- Used to detect device type and Gmail proxy requestsX-Forwarded-For- Used to determine the client’s IP address (when behind a proxy)
Response
The endpoint always returns a 200 status code with a 1x1 transparent GIF image, regardless of whether the token is valid.Response headers
Response body
Base64-encoded 1x1 transparent GIF:Example usage
Generate tracking pixel URL
Embed in email HTML
Example request
Deduplication
The server implements automatic deduplication to avoid counting multiple opens from the same email client:- Default deduplication window: 30 seconds
- Configurable via
DEDUP_WINDOW_MSenvironment variable - Duplicate opens are recorded but flagged with
is_duplicate: true
Gmail proxy handling
The server automatically detects requests from Gmail’s image proxy:- User-Agent contains
googleimageproxy - IP address matches known Google proxy ranges:
66.249.*64.233.*74.125.*
- The event is logged with
google_proxy_hitin debug metrics - If a suppression signal exists, the latency is measured and recorded
- The open may be suppressed based on sender suppression signals