Collector API Reference
Collector API Reference
Introduction
The Collector receives data sent from web plugins, native sdks or custom integrations and forwards it to our backend processing systems.
This is the shared transport layer used by:
Ad server pixels — deployed as 3rd party trackers in FreeWheel, GAM, or SpringServe ad responses
Video player plugins — pre-built for Brightcove, JW Player, VideoJS, Bitmovin, and Akamai AMP
Custom integrations — server-side proxies, native SDKs, or any bespoke implementation pushing data to the endpoint
For pre-built integrations, see the relevant vendor page. This reference is for teams building custom implementations or needing to understand the underlying protocol.
Authentication
Requests to the Collector endpoint must all be sent with an authorization header:
X-Api-Key: <apiKey>You can find your api key in your Watching That account. Failing to set this header or setting it to an invalid value will result in a 401 Unauthorized response.
Endpoints
POST https://collector.watchingthat.com/v5/in
POST https://c.p2r14.com/v5/inNOTE: We periodically change the latter endpoint domain to prevent ad blocker interference. For server environments use the former — it runs from a stable domain.
Data must be sent as JSON with Content-Type: application/json:
[
{ "<field1>": "<value>", "<field2>": "<value>" },
{ "<field1>": "<value>", "<field2>": "<value>" }
]Curl Example
curl -X POST \
'https://collector.watchingthat.com/v5/in' \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: 12345' \
-d '[ { "type": "init", "rid": "123-abc", "cst": 0 }, { "type": "play", "rid": "123-abc", "cst": 1000 } ]'Concepts
Content Sessions
A content session groups all events from a single video playback, identified by the rid field. All events in the same session share the same rid. Create a unique rid at the beginning of each session.
[
{ "rid": "abc123", "type": "init" },
{ "rid": "abc123", "type": "play" },
{ "rid": "foobar-qqq", "type": "imp" }
]NOTE: If sending from both server-side and client-side for the same session, use the same rid in both contexts.
Content Session Time
The cst field records milliseconds since session start (not wall clock time):
const startTime = Date.now();
const eventPayload = { cst: Date.now() - startTime };Ad Sessions
The adGid field groups all events for a single ad (request, load, start, impression, quartiles, complete, errors). Each ad in a session needs a unique adGid.
Type
The type field identifies the event. See Event Types below.
Event Fields
Field | Type | Required | Possible Values | Description |
|---|---|---|---|---|
| int |
| -1, 0, 1 | Ad Blocker detected. -1 = undetermined. |
| string |
|
| Ad: Advertiser Name |
| int | yes, for ad events | -1, 0, 1, ... | Break index: 0=PREROLL, 1/2/3=MIDROLL, -1=POSTROLL |
| int | yes, for ad events |
| Position of ad in break, starting from 0 |
| string |
|
| Ad: Creative Id |
| string |
|
| Ad: First deal ID in wrapper chain |
| string | yes, for ad events |
| Unique identifier linking all events of an ad |
| string |
|
| Ad: Ad ID |
| string |
|
| Ad Manager SDK Version |
| string |
|
| Ad: Media URL |
| string |
|
| Ad: Ad System |
| string |
| PREROLL, MIDROLL, POSTROLL | Ad break type |
| string |
|
| Ad: Tag URL after macro replacements |
| string[] |
|
| Ad: Wrapper creative IDs |
| string[] |
|
| Ad: Wrapper IDs |
| string[] |
|
| Ad: Wrapper ad system names |
| boolean |
|
| Is player autoplaying? |
| string |
|
| Browser name. Skip if sending from browser. |
| string |
| UK, US, DE, ... | 2 letter country code. Skip if sending from browser. |
| int | yes |
| Milliseconds since session start (init = 0) |
| object |
|
| Custom data object for analysis |
| string |
|
| Extra data for finding clusters in the app |
| string |
|
| Device name. Skip if sending from browser. |
| string |
| desktop, phone, tablet, tv | Device type |
| string | yes if error |
| Outer error code |
| string |
|
| Inner error code for more context |
| int |
| 0, 1 | Friendly Iframe |
| int |
|
| Player height |
| int |
|
| Video index in playlist (starts at 1) |
| string |
|
| IP address — used to resolve country, then removed |
| int |
| 0, 1 | Live (1) or VOD (0) |
| string |
|
| Unique video code/name |
| string |
|
| Ad Tag URL before macro replacements |
| string |
|
| Operating system name |
| string |
|
| Comma delimited video tags |
| int |
|
| Ad area visibility percentage |
| string |
|
| Unique player code/name |
| string |
|
| Playlist ID linking all sessions in a playlist |
| string |
|
| Video player version |
| string |
|
| Page URL |
| int |
| 0, 1 | Page visible indicator |
| string | yes |
| Unique video session ID |
| string |
|
| Short code for app or plugin |
| string |
|
| Event subtype |
| string |
|
| Video stream ID from IMA DAI SDK |
| string | yes | init, play, ... | Event type (see below) |
| string |
|
| App/plugin version |
| int |
|
| Player width |
| int |
|
| Window/Screen height |
| int |
|
| Window/Screen width |
Event Types
Value | Description |
|---|---|
| Start of session. Send static values (pu, src, v, idx) here. |
| Video Play |
| Ad requested |
| Ad break started |
| Ad Click |
| Ad Loaded |
| Ad Started |
| Impression |
| Ad First Quartile |
| Ad Second Quartile (midpoint) |
| Ad Third Quartile |
| Ad Complete |
| Skip ad |
| Video Ready |
| Video View |
| Error |
| Content started playing |
| Content First Quartile |
| Content Second Quartile |
| Content Third Quartile |
| Content 95% playthrough |
| User muted audio |
| User unmuted audio |
Custom event types can also be sent — see the Plugin Configuration Reference for details.