trackrv0.3.0trackr.casoon.de

← All examples

Tracking pixel

createPixelHandler() reads url and ref from the query string, records a pageview and always answers with a transparent GIF that must not be cached. Device, browser and OS are not detected on this path.

Tracking pixel

examples/output/pixel.json
{
  "url": "https://example.com/pixel.gif?url=/newsletter/october&ref=mail",
  "headers": {
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
    "accept-language": "en-US,en;q=0.9",
    "x-forwarded-for": "192.0.2.15"
  }
}
{
  "response": {
    "status": 200,
    "headers": {
      "cache-control": "no-store, no-cache, must-revalidate",
      "content-type": "image/gif",
      "pragma": "no-cache"
    },
    "bytes": 43
  },
  "stored": [
    {
      "type": "pageview",
      "url": "/newsletter/october",
      "referrer": "mail",
      "ts": 1791961200000,
      "sessionId": "6217de67bbf5a139"
    }
  ]
}
  • createPixelHandler
  • no JavaScript