Complete Pixel API reference for tracking events via GET requests when POST is not feasible.
4 minute read
This guide provides a complete reference for the RudderStack Pixel API.
Overview
The RudderStack Pixel API lets you track events and route them to your destinations using GET requests. Use this API when POST requests are not feasible — for example, when tracking email opens or page views in environments like AMP where POST requests do not add any value.
The page call records page views with optional context and properties.
For the page endpoint, RudderStack expects the basic page view properties (path, url, referrer, title) to be passed with context.page.{property} or with properties.{property}.
GET
/pixel/v1/page
Query parameters
writeKey
Required
String
Your source write key for authentication
anonymousId
Required
String
Anonymous identifier for the user. Either userId or anonymousId is required
userId
Optional
String
Unique identifier for the user in your database
name
Optional
String
Name of the page being viewed
context.library.name
Optional
String
Name of the library or SDK (for example, Rudderstack AMP SDK)
context.library.version
Optional
String
Version of the library or SDK
context.platform
Optional
String
Platform context (for example, AMP)
context.locale
Optional
String
User locale (for example, browser language)
context.userAgent
Optional
String
User agent string
context.screen.width
Optional
String
Screen width in pixels
context.screen.height
Optional
String
Screen height in pixels
context.page.path
Optional
String
Canonical page path
context.page.url
Optional
String
Full page URL
context.page.referrer
Optional
String
Referrer URL
context.page.title
Optional
String
Page title
properties.{key}=${value}
Optional
String
Custom page properties. Pass page view properties like path, url, referrer, and title either with context.page.{property} or with properties.{property}
Parameters that use dot notation (for example, context.page.path, context.screen.width) represent nested fields in the event payload. RudderStack maps these query parameters to the standard page event structure before sending to your destinations.
The above call maps to the following event payload (excluding fields RudderStack adds automatically, like messageId, originalTimestamp, sentAt, and receivedAt):
{"type":"page","anonymousId":"anon-123","name":"Home Page","properties":{"path":"/home","url":"https://example.com/home","referrer":"https://example.com/","title":"Home"},"context":{"locale":"en-US","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64)","page":{"path":"/home","url":"https://example.com/home","referrer":"https://example.com/","title":"Home"},"screen":{"width":1920,"height":1080}}}
Response codes
Code
Description
200 OK
Request processed successfully
400 Bad Request
Invalid request or missing required parameters
Send a track call
The track call records user actions with event-specific properties.
Pass event-related properties with properties.{key}=value.
GET
/pixel/v1/track
Query parameters
writeKey
Required
String
Your source write key for authentication.
anonymousId
Required
String
Anonymous identifier for the user. Either userId or anonymousId is required.
event
Required
String
Name of the event being tracked.
userId
Optional
String
Unique identifier for the user in your database.
name
Optional
String
Page name for context.
context.library.name
Optional
String
Name of the library or SDK (for example, Rudderstack AMP SDK).
context.library.version
Optional
String
Version of the library or SDK.
context.platform
Optional
String
Platform context (for example, AMP).
context.locale
Optional
String
User locale (for example, browser language).
context.userAgent
Optional
String
User agent string.
context.screen.width
Optional
String
Screen width in pixels.
context.screen.height
Optional
String
Screen height in pixels.
context.page.path
Optional
String
Canonical page path.
context.page.url
Optional
String
Full page URL.
context.page.referrer
Optional
String
Referrer URL.
context.page.title
Optional
String
Page title.
properties.{key}
Optional
String
Custom event properties. Use context.page.{property} for page view properties; use properties.{key}=value for event-specific properties.
Parameters that use dot notation (for example, context.page.path, properties.productId) represent nested fields in the event payload. RudderStack maps these query parameters to the standard track event structure before sending to your destinations.
The example call above maps to the following event payload (excluding fields RudderStack adds automatically, such as messageId, originalTimestamp, sentAt, and receivedAt):
{"type":"track","anonymousId":"anon-123","event":"Product Viewed","name":"Product Page","properties":{"productId":"sku-123","revenue":29.99},"context":{"locale":"en-US","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64)","page":{"path":"/product/sku-123","url":"https://example.com/product/sku-123","referrer":"https://example.com/","title":"Product Page"},"screen":{"width":1920,"height":1080}}}
Response codes
Code
Description
200 OK
Request processed successfully
400 Bad Request
Invalid request or missing required parameters
Limitations
The Pixel API does not support overriding the integration key to send data to selective destinations. All configured destinations receive the events.
Questions? We're here to help.
Join the RudderStack Slack community or email us for support
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.