---
title: "Add placement tracking code"
type: reference
method: POST
path: /rest-api/tracking-code/placement/add.do
tag: "Banners"
---

# Add placement tracking code

`POST https://YOUR-NETWORK-DOMAIN/rest-api/tracking-code/placement/add.do`

Adds or replaces a 3rd party tracking code for the specified placement and country combination. If a tracking code already exists for the same placement and country, it will be overwritten with the new value. Use country code '*' to set a global tracking code that fires for all countries. Returns a JSON object with a 'success' boolean indicating whether the operation completed successfully.

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `domainId` | integer | yes | `4001` | The unique numeric identifier of the placement to add the tracking code to |
| `country` | string | yes | `US` | ISO country code to target (e.g., 'US', 'GB'), or '*' to set a global tracking code that applies to all countries |
| `code` | string | yes | `<img src='https://tracker.example.com/pixel.gif' />` | The HTML tracking code snippet to be injected during ad serving for the specified country |

## Responses

- `200` — Operation result with success status
- `400` — Bad request — invalid or missing parameters
- `401` — Authentication error
- `403` — Forbidden — insufficient permissions

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/tracking-code/placement/add.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'domainId=4001' \
  --data-urlencode 'country=US' \
  --data-urlencode 'code=<img src='\''https://tracker.example.com/pixel.gif'\'' />'
```

Source: https://epom.com/ad-server/docs/api/banners/post-tracking-code-placement-add