---
title: "Get the conversion tracking code of an action"
type: reference
method: GET
path: /rest-api/action/id/{id}/tracking-code.do
tag: "Actions"
---

# Get the conversion tracking code of an action

`GET https://YOUR-NETWORK-DOMAIN/rest-api/action/id/{id}/tracking-code.do`

Returns what the console's Conversion Tracking Code window shows for the action. 'postback' (needs ACTION_TRACKING_S2S) — the server-to-server URLs: actionTrackUrl, fired with the click id the landing page received in the easclid parameter (landingUrlExample shows the $$CLICK_ID$$ macro to put in the click URL), and the legacy per-action variant (subIdMacro, subIdLandingUrlExample, subIdActionTrackUrl). 'pixel' (needs ACTION_TRACKING_CODE and a campaignId, as the pixel is campaign-specific) — jsPixelCode, the image pixel URL pixelTrackingUrl, and jsPixelCodeWithPiggybacks when the campaign has piggyback pixels on and the role holds PIGGYBACK_PIXEL_TRACKING. The codes are built on 'host' when given (one of the selectable ad-serving domains), else on the campaign's conversion-pixel domain, else on the action's own; the domain used is echoed in 'host'. Requires VIEW access to the action, and to the campaign's advertiser when campaignId is given.

## Path params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `id` | integer | yes | `301` | The numeric database ID of the action |

## Query params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `campaignId` | integer | no | `2001` | Campaign the codes are for; required for the pixel |
| `host` | string | no | `ads.example.com` | Ad-serving domain to build the codes on; one of the selectable domains |

## Responses

- `200` — The tracking codes the caller may see, under postback and/or pixel
- `400` — Unknown ad-serving domain, or only the pixel is permitted and no campaignId was given
- `401` — Authentication error
- `403` — No access to the action or campaign, or neither ACTION_TRACKING_S2S nor ACTION_TRACKING_CODE
- `404` — Action or campaign not found

## Example request

```bash
curl --request GET \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/action/id/301/tracking-code.do?campaignId=2001&host=ads.example.com' \
  --header 'X-Api-Key: YOUR_API_KEY'
```

Source: https://epom.com/ad-server/docs/api/actions/get-action-id-tracking-code