Skip to content
Browse documentation

Conversion pixels (image, iframe, JavaScript)

Report conversions from the advertiser's thank-you page with /px, /px.gif or /px.js, and how the click is found.

Last updated 4 min read

On this page

Use a pixel when the advertiser cannot make server calls. The pixel runs in the buyer's browser on the confirmation ("thank-you") page and reports the conversion to TrackCrown. Pixels are less reliable than server-to-server postbacks: ad blockers, privacy settings and pages that close early can stop them.

Before you start#

The offer must accept pixels. Open the offer → Tracking tab and set Conversion tracking to Server postback or pixel or Pixel only. With Server postback only, every pixel answers offer does not accept pixel conversions.

Get the snippets#

  1. Open the offer → Tracking tab → Advertiser conversion tracking → Pixels for the thank-you page.
  2. Pick the event tab (one tab per event of the offer).
  3. Copy Image pixel, iframe pixel or JavaScript pixel.
  4. Replace ORDER_TOTAL and ORDER_ID with the checkout's values.

Advertisers see the same snippets on their portal's Integration page.

HTML
<!-- Image pixel -->
<img src="https://trackcrown.com/px?offer_id=SHOP01&amp;event=sale&amp;amount=ORDER_TOTAL&amp;txid=ORDER_ID" width="1" height="1" style="display:none" alt="" referrerpolicy="no-referrer-when-downgrade" />

<!-- iframe pixel -->
<iframe src="https://trackcrown.com/px?offer_id=SHOP01&amp;event=sale&amp;amount=ORDER_TOTAL&amp;txid=ORDER_ID" width="1" height="1" frameborder="0" scrolling="no" style="display:none"></iframe>

<!-- JavaScript pixel -->
<script src="https://trackcrown.com/px.js?offer_id=SHOP01&amp;event=sale&amp;amount=ORDER_TOTAL&amp;txid=ORDER_ID" async></script>

Endpoints#

PathMethodAnswer
/pxGET (HEAD returns headers only and never converts)A 1×1 transparent GIF, always HTTP 200 — the outcome is in the X-ArcTrack-Conversion response header.
/px.gifGETAlias of /px for ad servers that require an image extension.
/px?format=htmlGETAn HTML document (used automatically when the browser loads /px in an <iframe>).
/px.jsGETA small script that finds the click ID on the page and loads /px?format=js.

The X-ArcTrack-Conversion header (a fixed technical name, the same for every brand) holds the status (approved, pending), the status and reason (rejected; outside_window) or error: <message> (for example error: click_id required). It is readable from JavaScript (Access-Control-Expose-Headers).

Parameters#

Pixels take the S2S parameters with these differences:

ParameterPixel behaviour
tokenIgnored — a token on a public page is never honoured.
click_idNeeded unless the pixel cookie or a coupon identifies the visit.
offer_idRecommended. Must match the click's offer when both are present.
statusIgnored: the offer's default status and your conversion rules decide.
payoutIgnored.
revenueUsed only by offers whose revenue type is dynamic.
aff_idIgnored (the click decides the partner).
gclid, gbraid, wbraid, msclkidNot used to find a click on pixels.
conversion_idNot allowed: conversion_id updates need a server-to-server postback.
formatgif, html or js — overrides the automatic choice.

How the pixel finds the click#

  1. click_id (or transaction_id, tid) on the pixel URL.
  2. For /px.js only: the script also looks at the page URL (click_id, transaction_id, tid, atk_cid), then ArcTrack.clickId() from the landing-page SDK, then the SDK's atk_cid value in local storage and in a cookie of the page's own domain.
  3. The First-party pixel cookie: if Settings → Workspace → First-party pixel cookie is on, partner links (/r/…, /click) and smart links (/s/…) set an atk_cid cookie (30 days, HttpOnly, SameSite=None; Secure over HTTPS) on the tracking domain. A pixel served from the same tracking domain sends it back.
  4. A coupon_code with offer_id (coupon attribution without click).

Otherwise the pixel answers click_id required.

HTML partner postbacks#

Partners can register HTML / iframe pixel postbacks (their own tracking snippets). These can only run in the buyer's browser, so they are delivered only by a pixel response that can render HTML:

  • an iframe pixel (or /px?format=html): the response is an HTML page containing the snippets, served with Content-Security-Policy: sandbox allow-scripts;
  • a JavaScript pixel (/px.js): the snippets are rendered in a hidden, sandboxed iframe.

Image pixels and server-to-server postbacks cannot render them: such deliveries are logged as failed with html postback not delivered.

Shopify example#

Shopify runs code on the checkout only as a custom pixel (Settings → Customer events → Add custom pixel). Load the SDK in your theme so the click ID is stored on your shop's domain, then add:

JavaScript
analytics.subscribe("checkout_completed", async (event) => {
  const clickId = await browser.cookie.get("atk_cid");
  if (!clickId) return; // not a tracked visit
  const checkout = event.data.checkout;
  const params = new URLSearchParams({
    click_id: clickId,
    offer_id: "SHOP01",
    amount: String(checkout.totalPrice?.amount ?? ""),
    currency: checkout.currencyCode ?? "",
    txid: String(checkout.order?.id ?? checkout.token ?? ""),
  });
  fetch("https://trackcrown.com/px?" + params.toString(), { mode: "no-cors", keepalive: true });
});

Sending the order ID as txid means the same order is never counted twice if the event fires again. A ready-made version of this pixel, the Shopify Flow reversal for cancelled orders and a WooCommerce plugin are on Tracking → Integrations → E-commerce; see E-commerce, call tracking and e-mail offers.

Test a pixel#

Open the pixel URL with &test=1 in a browser's developer tools (Network tab) and read the X-ArcTrack-Conversion header. With test=1 nothing is stored.

Pixel requests are listed in Reports → Postback log → Received with their result — also failed ones, filed by their offer, click ID or your workspace's own tracking domain. A pixel that names none of these (for example click_id required without offer_id on a shared tracking domain) does not appear there — the X-ArcTrack-Conversion header is the place to look.

Something unclear or missing in this article?Tell us