---
updatedAt: 2025-09-18T21:58:45.000Z
agentTools:
  projectIndex: https://dev.kevel.com/llms.txt
---

# Get Conversion Tracking Pixel

## Why Get a Conversion Tracking Pixel?

Occasionally, you may wish to track conversions for an advertiser's campaign using cookies. The Get Conversion Tracking Pixel API endpoint enables you to return a conversion tracking pixel wrapped in JavaScript that you can place on an HTML page to track these conversions.

When the JavaScript is loaded, Kevel will track the conversion for the creative, flight, campaign, and advertiser that referred the user to the conversion page.

## API Syntax

When using the Get Conversion Tracking Pixel API endpoint, it is important to understand the syntax required to make the request. Because the Kevel API is a RESTful API, there is a specific request format that must be followed to ensure the endpoint can process the request. The format is:

`GET https://api.kevel.co/v1/advertiser/{AdvertiserID}/trackingCode`

Where:

* `GET` - the type of API request being made.
* `https://api.kevel.co` - the URL for the request.
* `v1` - the API version.
* `advertiser` - the API endpoint being called.
* `AdvertiserID` - the ID associated with the advertiser.
* `trackingCode` - the pixel code use for the conversion tracking.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "management-api-2",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.kevel.co"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "X-Adzerk-ApiKey",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v1/advertiser/{AdvertiserID}/trackingCode": {
      "get": {
        "summary": "Get Conversion Tracking Pixel",
        "description": "",
        "operationId": "get-conversion-tracking-pixel",
        "parameters": [
          {
            "name": "AdvertiserID",
            "in": "path",
            "description": "The ID of the Advertiser",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n   \"trackingCode\": \"<script type=\\\"text/javascript\\\">var it=document.createElement(\\\"img\\\");var u=\\\"https://engine.adzerk.net/e/1234/12345/e.gif\\\";var t=new Date().getTime();var ut=u+\\\"?_=\\\"+t;it.src=ut;it.border=0;</script>\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "trackingCode": {
                      "type": "string",
                      "example": "<script type=\"text/javascript\">var it=document.createElement(\"img\");var u=\"https://engine.adzerk.net/e/1234/12345/e.gif\";var t=new Date().getTime();var ut=u+\"?_=\"+t;it.src=ut;it.border=0;</script>"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl -X GET -H 'X-Adzerk-ApiKey:<APIKEY>' https://api.kevel.co/v1/advertiser/12345/trackingCode"
            },
            {
              "language": "javascript",
              "code": "const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getConversionTrackingCode() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let advertiser = await client.run(\"advertiser\", \"getTrackingCode\", {id: 1234});\n  console.log(advertiser);\n}\n\ngetConversionTrackingCode();"
            },
            {
              "language": "ruby",
              "code": "require \"adzerk\"\n\ndef get_conversion_tracking_code()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    advertiser_id = 12345\n    pp client.advertisers.get_conversion_tracking_code(advertiser_id)\nend\nget_conversion_tracking_code()"
            }
          ],
          "samples-languages": [
            "curl",
            "javascript",
            "ruby"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "X-Adzerk-Sdk-Version",
        "value": "Readme.io:ManagementAPI2"
      }
    ],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```