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

# Edit placement tracking code

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

Updates an existing 3rd party country-level tracking code for the specified placement. The tracking code identified by 'id' gets the code sent, and moves to the country sent when that differs; the global code is edited with country '*' and id 0. Returns a JSON object with a 'success' boolean indicating whether the update completed successfully.

## Form params

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

## Responses

- `200` — Operation result with success status
- `400` — country is not a two-letter code, or the placement already has a code for it; or country * with an id other than 0
- `401` — Authentication error
- `403` — The role lacks the PLACEMENT_THIRD_PARTY_TRACKING permission, or no UPDATE share on the placement
- `404` — No such placement, or no such tracking code of it

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/tracking-code/placement/edit.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'id=1' \
  --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-edit