# Event Tracking Service API (1.1)

Tracking of events of any type for logging and future analysis purposes

## Tracking

Endpoints to capture events.

In each endpoint, the complete requested will be captured. Thus, additional query parameters and json properties in the request payload can be added on top of the ones described here.

### Capture event

All the contents of the HTTP request are logged and indexed for future analysis.
That includes the full URL with query parameters and all request headers (including Audience-specific cookies).

This endpoint then returns the string "OK".

##### query Parameters

|     |     |
| --- | --- |
| id_{idType} | string<br>Overrides the request _UserId_ which is extracted by Cookie by default.<br>The `{idType}` should be replaced with the type of the _UserId_ while the parameter value will be _UserId_'s id itself. |
| user[type] | string<br>Overrides the request _UserId_ which is extracted by Cookie by default.<br>It must be defined together with `user[id]`.<br>It has less precedence than the `id_{idType}` query param.<br>This query param must be sent url encoded (`user%5Btype%5D=`). |
| user[id] | string<br>Overrides the request _UserId_ which is extracted by Cookie by default.<br>It must be defined together with `user[type]`.<br>It has less precedence than the `id_{idType}` query param.<br>This query param must be sent url encoded (`user%5Bid%5D=`). |
| cookieCheck | string<br>If missing along with the **adstax_uid** Cookie, the request will be redirected to self to<br>test cookie stickiness. The redirect will have this query param set to true. |
| clientId | string<br>The client identifier |
| siteId | string<br>The site identifier |
| type | string<br>The event type |
| cookies | boolean<br>Default: true<br>If false, a new **adstax_uid** Cookie won't be generated if it is missing from the request. |

### Responses

**200**

OK

**307**

Redirect to self to test cookie stickiness

### Capture event and redirect to URL

This endpoint then redirects to the given URL.

##### query Parameters

### Responses

**302**

Redirect to the given ourl

**307**

Redirect to self to test cookie stickiness

**404**

Not found. Query param 'ourl' may be missing

### Capture event and return image

This endpoint then returns a pixel image.

##### query Parameters

### Responses

**200**

Pixel GIF

**307**

Redirect to self to test cookie stickiness

### Capture event and parse it according to a template

This endpoint then returns the string "OK".

##### path Parameters

|     |     |
| --- | --- |
| template<br>required | string<br>The id of the template to apply. |

### Responses

**200**

OK

**404**

The template could not be found

### Capture server-to-server event

All the contents of the HTTP request are logged and indexed for future analysis.
That includes the full URL with query parameters, the body payload and all request headers.

This endpoint then returns the string "OK".

##### Request Body schema: application/json

Event to capture.
The event can have more properties (nested properties as well) than the ones defined below.

|     |     |
| --- | --- |
| clientId | string<br>The client identifier. |
| siteId | string<br>The site identifier. |
| type | string<br>The event type. |
| user | object<br>Overrides the request _UserId_ which is extracted by Cookie by default.<br>It has less precedence than the `id_{idType}` query param. |
| userAgentHeader | string<br>The value of the User-Agent Header at the time the event was triggered on the user client. |
| refererHeader | string<br>The value of the Referer Header at the time the event was triggered on the user client.<br>For example: `http://foo.com` |
| documentLocation | string<br>The [Document.location](https://developer.mozilla.org/en-US/docs/Web/API/Document/location) of the<br>page the user was at when it made the event.<br>For example: `http://foo.com/a/b/c`. |
| referrer | string<br>URL of the page the user was at before traveling to the page where the event was made.<br>This field can be obtained, for example, by using the `window.referrer` or the<br>`window.location.href` methods in browsers.<br>For example: `http://google.com`. |
| ip | string<br>The user IP. |
| timestamp | string<br>Specifies the timestamp of the event, which must follow the following ISO 8601 format: `YYYY-MM-DD'T'hh:mm:ss[.sss]Z`. |

### Responses

**200**

OK

**400**

Validation error

### Manage user privacy preferences.

### Returns the current privacy status

The privacy cookie is read if it exists and the current privacy status is returned.

### Responses

**200**

Successful request

### Opts out of user tracking

The privacy cookie is updated so that future match requests for that user are ignored.

### Responses

**200**

Successful request

### Opts in to user tracking

The privacy cookie is updated so that future match requests are considered normally.

### Responses

**200**

Successful request
