Pixel Service Integration Guide
This page explains how to implement the Rokt Pixel Service to connect conversions with your campaigns. The Pixel Service is intended as a fallback for situations where the Rokt Web SDK is not an option. A common example is advertisers in regulated industries — such as financial services or healthcare — whose security policies enforce a strict Content Security Policy (CSP) that blocks third-party JavaScript execution, but still permits image requests.
Your dedicated Rokt account manager will assist in configuring your account for the Pixel Service. They will provide the required API key and any additional resources needed.
The instructions below will require development resources to complete. If you need further assistance, please contact your Rokt account manager.
All requests to the Pixel Service are made as HTTP GET requests to:
https://pixels.mparticle.com/v1/{api_key}/Pixel
Where {api_key} is the Rokt API key provided by your account manager.
1. Track Page Views1. Track Page Views への直接リンク
To track a page view, send a pixel request on each page load. Place the request in the <head> of your page, or fire it from your JavaScript as soon as the page loads.
1.1 Enter your Rokt API Key1.1 Enter your Rokt API Key への直接リンク
Replace {api_key} in the URL with the Rokt API key provided by your dedicated Rokt account manager.
Your Rokt API Key is a unique credential provided by your Rokt account manager that securely enables your site to connect and interact with the Rokt Pixel Service.
The Pixel Service is intended for organizations whose Content Security Policy (CSP) blocks third-party JavaScript. If your organization does not have this restriction, use the Rokt Web SDK instead, which provides richer functionality.
1.2 Identify the user1.2 Identify the user への直接リンク
Rokt requires a consistent user identifier across all pixel calls in a session to stitch together funnel events. Without one, each page view is treated as a separate anonymous user, making it impossible to track funnel progression or build retargeting audiences for users who showed high intent but did not convert.
Pass user identities using comma-separated ui_t (identity type keys) and ui_v (identity type values) parameters.
Known users (email available)
If the user has provided their email address, pass both the session identifier and the email so Rokt can link any earlier anonymous page views to the now-known user:
- Un-hashed email:
ui_t=other3,email - SHA-256 hashed email:
ui_t=other3,other
ui_t=other3,email&ui_v={sessionId},j.smith%40example.com
Anonymous users (no PII available)
If the user has not provided any PII — for example, a user browsing an application funnel without logging in — you must still pass a session-based identifier so Rokt can tie all page view events in that session together.
Generate a unique session ID when the user first arrives and persist it in sessionStorage for the duration of the visit. Pass it on every pixel call using ui_t=other3:
function getSessionId() {
let sessionId = sessionStorage.getItem('rokt_session_id');
if (!sessionId) {
sessionId = crypto.randomUUID();
sessionStorage.setItem('rokt_session_id', sessionId);
}
return sessionId;
}
ui_t=other3&ui_v={sessionId}
The session ID is not tied to a real user identity — it exists only to group events within a single browsing session. If the user later provides their email (for example, on a conversion confirmation page), include both identifiers so Rokt can associate the session with a known user:
ui_t=other3,email&ui_v={sessionId},j.smith%40example.com
This pattern enables two outcomes for anonymous users who do not convert:
- Rokt can see that the user progressed through the funnel (high intent signal).
- Rokt places those users into a retargeting audience to re-engage them after the session ends.
1.3 Set user attributes1.3 Set user attributes への直接リンク
You can include user attributes with each pixel request using comma-separated ua_k (user attribute keys) and ua_v (user attribute values) parameters.
For a list of attributes Rokt recommends collecting, see Recommended user attributes.
ua_k=firstname,lastname,zip&ua_v=Jane,Smith,98103