## Overview

Below explains how we track the impressions and clicks you see in the Reporting UI and API.

## Impression Tracking - API Requests

When Kevel's Ad Decision Engine provides a [Response](https://dev.kevel.co/v1.0/reference/response) to your [Decision API Request](https://dev.kevel.co/v1.0/reference/request), it'll include a field called `impressionUrl`, as shown below:

```json
{
  "adId": 111,
  "creativeId": 222,
  "flightId": 333,
  "campaignId": 444,
  "clickUrl": "https://e-1234.adzerk.net/r?...",
  "impressionUrl": "https://e-1234.adzerk.net/i.gif?..."
  ...
}
```

This URL is unique to the ad, so if fired, it'll record that an impression happened for that particular ad.

In order to make it fire, you'll have to issue a GET or POST to this URL endpoint. Alternatively, you could place this `impressionUrl` directly on the page using an image tag, but we recommend issuing it server-side to help combat reporting discrepancies that could happen because of ad blockers. More info [here](https://dev.kevel.co/v1.0/docs/proxying-impressions-through-your-own-server).

> 📘
>
> Impression tracking URLs expire after 24hrs. Impression URLs fired after 24hrs will return a 200 response, but no impression will be recorded.
>
> If the same unique Impression URL is fired multiple times, multiple impressions will be recorded. Kevel does not deduplicate Impressions.

## Click Tracking

Kevel tracks clicks with a click tracking URL. When a user clicks on an ad, this link records a click in our reporting server, and then redirects the user's browser to the creative's destination page. The URL looks like:

`http://e-1234.adzerk.net/r?e=eyJ0cyI6MTM2Mjc3MT...In0&s=K9N90sUT247it9GXOEmh49HPmBY`

If you use the click tracking macro `%URL%` when setting up a JavaScript/HTML type creative, Kevel automatically generates our tracking URL wherever the macro is placed in the creative.

In the [Decision API Response](https://dev.kevel.co/v1.0/reference/response), you'll see the click URL under the `clickURL` parameter.

You'll want to grab this URL and redirect the user to it if they click on the ad. Alternatively you can also call to it server-side using a GET or POST request type.

> 📘
>
> Kevel registers a click whenever a user clicks on an ad with a unique impression. If a user clicks on the same ad multiple times without refreshing the page, we will not register new impressions, and therefore will not count the clicks after the initial click.
>
> A click fired without an associated impression is tracked as a valid click and recorded.
>
> Click tracking URLs do not expire.

## Bot Filtering

Bot filtering refers to the automatic filtering-out of impressions from bots and spiders. A request from a detected bot or spider will be fulfilled, but the impression will be categorized as Invalid UA Impressions and subsequent clicks as Invalid UA Clicks in our reporting system.

| Scenario | Action |
| --- | --- |
| Making requests to the Decision API | Must set `"enableBotFiltering": true` in the Decision API Request after placements<br>_Note: if firing impressions/clicks/events server to server, be sure to send the user-agent header in requests._ |
| Using ados.js ad requests | Nothing. Kevel automatically filters impressions for bots |

Updated 10 months ago

### What’s Next

- [Proxying Impressions Through Your Own Server](https://dev.kevel.com/docs/proxying-impressions-through-your-own-server)
