Tracking Pixel
The Tracking Pixel endpoint serves a 1x1 transparent GIF image that records an event when loaded. This is designed for environments where JavaScript execution is not possible, such as email clients and HTML-only contexts.
Endpoint
GET /v1/pixel/{type}Where {type} is the event type: track, page, identify, or group.
Authentication
The pipeline key is passed as a query parameter:
?wk=dk_live_abc123...How It Works
- A client (browser, email client, etc.) requests the pixel URL
- The Ingestion Gateway parses the query parameters into an event payload
- The event is published to the Kafka
raw-eventstopic - The gateway returns a 1x1 transparent GIF with appropriate cache-busting headers
<img> request → Ingestion Gateway → Kafka → 1x1 GIF responseThe response includes:
| Header | Value |
|---|---|
Content-Type | image/gif |
Cache-Control | no-store, no-cache, must-revalidate |
Pragma | no-cache |
Expires | 0 |
Query Parameters
Event data is encoded as query parameters:
| Parameter | Description | Example |
|---|---|---|
wk | Pipeline key (required) | dk_live_abc123... |
e | Event name (for track events) | Email+Opened |
uid | User ID | user_98765 |
aid | Anonymous ID | anon_abc123 |
p.* | Event properties (dot notation) | p.campaign_id=camp_001 |
t.* | User/group traits | t.email=jane@example.com |
ts | Event timestamp (Unix milliseconds) | 1740493800000 |
mid | Message ID for deduplication | a1b2c3d4 |
cb | Cache buster (ignored, prevents caching) | {random} |
Examples
Email Open Tracking
Track when a recipient opens an email:
<img
src="https://data.example.com/v1/pixel/track?wk=dk_live_abc123&e=Email+Opened&uid=user_98765&p.campaign_id=camp_001&p.email_subject=February+Newsletter&cb=1740493800"
width="1"
height="1"
alt=""
style="display:none"
/>This records a track event named Email Opened with properties campaign_id and email_subject, tied to user_98765.
Page View in AMP
Track a page view in an AMP page where custom JavaScript is restricted:
<amp-pixel
src="https://data.example.com/v1/pixel/page?wk=dk_live_abc123&p.url=CANONICAL_URL&p.title=TITLE&cb=RANDOM"
layout="nodisplay"
></amp-pixel>Simple Conversion Tracking
Track a conversion in an environment where you can only embed an image:
<img
src="https://data.example.com/v1/pixel/track?wk=dk_live_abc123&e=Purchase&uid=user_98765&p.order_id=ORD-001&p.revenue=99.99&p.currency=USD&cb=1740493800"
width="1"
height="1"
alt=""
style="display:none"
/>Always include a cb (cache buster) parameter with a random or timestamp value. This prevents email clients and browsers from caching the pixel and skipping subsequent requests.
Dynamic Pixel URLs
You can generate pixel URLs server-side to include user-specific data:
function buildPixelUrl(pipelineKey, event, userId, properties) {
const base = "https://data.example.com/v1/pixel/track";
const params = new URLSearchParams({
wk: pipelineKey,
e: event,
uid: userId,
cb: Date.now().toString(),
});
for (const [key, value] of Object.entries(properties)) {
params.set(`p.${key}`, String(value));
}
return `${base}?${params.toString()}`;
}
const url = buildPixelUrl("dk_live_abc123", "Email Opened", "user_98765", {
campaign_id: "camp_001",
email_subject: "February Newsletter",
});
// https://data.example.com/v1/pixel/track?wk=dk_live_abc123&e=Email+Opened&uid=user_98765&cb=1740493800000&p.campaign_id=camp_001&p.email_subject=February+NewsletterLimitations
| Limitation | Detail |
|---|---|
| GET only | Pixel requests use GET, so event data is encoded in the URL |
| URL length | Most clients support up to ~2,000 characters; keep payloads small |
| No response data | The response is always a GIF; errors are logged server-side |
| No cookies | Email clients typically strip cookies; anonymous identity is not available |
| Caching | Some email clients pre-fetch or cache images; use the cb parameter |
Email open tracking is approximate. Some clients block remote images entirely, while others pre-load them regardless of whether the recipient reads the email. Use pixel data as a directional signal, not an exact metric.
Best Practices
- Always URL-encode parameter values. Spaces should be
+or%20, special characters should be percent-encoded. - Keep URLs under 2,000 characters. Send only essential properties via the pixel; enrich the event in the processing layer if needed.
- Use
userIdrather thananonymousIdfor pixel events since cookies are typically not available. - Include a
messageIdif you embed the same pixel in multiple locations and want to deduplicate.