---
title: "Batch add banner tracking codes"
type: reference
method: POST
path: /rest-api/tracking-code/banner/add/batch.do
tag: "Banners"
---

# Batch add banner tracking codes

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

Adds the same 3rd party tracking code to multiple banners in a single batch request. Each banner in the domainIds array receives the same tracking code for the specified country. If a tracking code already exists for a given banner-country pair, it will be overwritten. The response is a JSON map keyed by banner ID, where each value is an object with a 'success' boolean indicating the result for that banner.

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `domainIds` | array<integer> | yes | `5001` | Array of unique numeric banner identifiers 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 each banner and the specified country |

## Responses

- `200` — Map of banner IDs to operation results
- `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/banner/add/batch.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'domainIds=5001' \
  --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-banner-add-batch