> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apostra.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Third-party trackers by scope

> Where a third-party tracker can be set (advertiser, campaign or media buy), how the levels add up, how many each can hold, and when a tracker reaches a seller.

A third-party tracker is a pixel from a measurement or verification vendor, such as
a Campaign Manager 360 placement or an IAS or DoubleVerify tag. Apostra attaches it
to the creatives it sends a seller. You can set a tracker at three levels, and
each level can hold its own list.

| Scope | Set with | Reaches |
| - | - | - |
| Advertiser | `save_advertiser` `tracking.trackers` | Every campaign and media buy of the advertiser. |
| Campaign | `save_campaign` `tracking.trackers` | Every media buy of the campaign, so every seller in it. |
| Media buy | `save_media_buy` `tracking.trackers` | The creatives sent to that one buy's seller, and no other. |

A tracker belongs to the advertiser, the campaign or the media buy. It never
attaches to a package or a creative.

## The levels add up

A tracker at a narrower level **adds to** the trackers of the wider ones. It never
replaces them and never turns one off.

* A media buy's creatives carry the advertiser's trackers, the campaign's trackers
  and the buy's own, all together.
* A verification pixel on the campaign keeps firing on every seller when you add a
  publisher pixel to one buy.
* The one way to turn an inherited advertiser tracker off is a campaign override
  (`tracking.overrides` on `save_campaign`), as before. A media buy has no
  overrides.

If the same tracker is set at more than one level, it fires once. Two trackers are
the same when they have the same event (impression, click or a custom event
name) and the same URL after Apostra writes it in AdCP macros. Where a tracker is
repeated, Apostra credits the narrower level.

## One tracker per publisher in a cross-publisher campaign

A third-party ad server often keys its reports on the URL, with the publisher in
the path, so one shared URL cannot tell publishers apart. To measure each
publisher on its own, put that publisher's tracker on its media buy:

* Put what every seller shares, such as a verification pixel, on the campaign or
  the advertiser.
* Put each publisher's own placement URL on that publisher's media buy only.

Each seller then receives the shared trackers and its own placement URL, and no
other publisher's. One campaign keeps its budget, its optimization across sellers
and the per-publisher measurement together.

`{MEDIA_BUY_ID}` and the other identity macros are still filled for each buy when
the trackers are sent, so a shared tracker URL can also say which buy it came
from.

## How many each level holds

Each level holds at most **10** trackers of its own: 10 for the advertiser, 10 for
a campaign and 10 for a media buy. There is no combined limit, so one media buy
can carry up to 30 trackers in all. A write that sends more than 10 for one
level is refused, and Apostra never drops a tracker to fit a count.

A seller's format can accept fewer trackers than you set. When the whole set is
larger than the format's tracker slots, Apostra sends none of the third-party
trackers with that creative, the shared ones on the campaign and advertiser
included, and reports the trackers that were not delivered. It never sends part
of the list. A buy's own tracker makes the set larger, so check the format's
slots before adding one. See
[Trackers to traffic](https://docs.apostra.com/v3/trackers-to-traffic.md#when-a-sellers-format-has-no-slot-for-our-tracker).

## Set a media buy's trackers

Send `tracking` on its own with the buy's id:

```json theme={null}
{
  "mediaBuyId": "mb_k3x9a1",
  "idempotencyKey": "engie-cmi-trackers",
  "tracking": {
    "trackers": [
      {
        "name": "CM360 CMI placement",
        "trackerType": "impression",
        "url": "https://ad.doubleclick.net/ddm/trackimp/N445802.5898908SCOPE3/B37326443.462610904;dc_trk_aid=657285655"
      }
    ]
  }
}
```

`trackers` is the buy's complete list: a tracker you leave out is removed. Read
the list back with `get` for the media buy and `include: ["tracking"]`. It returns
the buy's own trackers and a `trackingRevision`; send that back as
`tracking.expectedRevision` to refuse an update that raced another. The read
does not merge in the campaign's or the advertiser's trackers, which you read on
their own.

When you create a media buy, you can send `tracking` with the create. It is saved
once the draft exists, and the create stages exactly one buy for it. If a create
stages more than one buy, or the trackers cannot be saved, the response says the
draft was created and that the trackers were not saved. Set them with
`mediaBuyId` and `tracking` for the buy they belong to.

## When a tracker reaches the seller

Trackers go to a seller with a creative: when Apostra books the buy, sends a
creative change for it or syncs its creatives. Changing a tracker does not resend
creatives a seller already holds, for any level. Set a media buy's trackers
before its creatives are sent. If you change them on a buy that is already
running, the change takes effect on the next creative send.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.