## Overview

User-level targeting refers to targeting that knows information about the particular individual seeing the ad. This data is tied to a persistent ID called the UserKey, which is passed in the `key` value of the `user` object of the [Decision API request](https://dev.kevel.co/v1.0/reference/request). This information is stored in Kevel's UserDB in JSON format.

The main uses cases of user-level targeting are:

- [Interest / Behavioral Targeting](https://dev.kevel.co/docs/interest-targeting)
- [Excluding Ads Based on Behavior](https://dev.kevel.co/docs/behavioral)
- [Demographic / Custom Properties Targeting](https://dev.kevel.co/docs/demographic)
- [Retargeting / Segment Targeting](https://dev.kevel.co/v1.0/docs/retargeting-1)

## Passing the UserKey

For user-level targeting to work, you'll need to send the same persistent UserKey ID as the key value in the `user` object in the Decision API request every time the user sees an ad.

Kevel will cross-reference this UserKey with UserDB and see if there's a record associated with the User. If there is a match, this information will be used by the Ad Decision Engine to pick the right ad, based on what type of user-level targeting you have set up.

An example Decision Request with a Userkey (`key`) included is:

JSON

```json
{
  "placements": [
    {
      "divName": "homepage",
      "networkId": 23,
      "siteId": 667480,
      "adTypes": [5],
      "eventIds": [12,13,14]
    }
  ],
  "user" : {
    "key": "ad39231daeb043f2a9610414f08394b5"
  }
}
```

## UserDB Logs and Properties

Logs of your account's UserDB endpoint activity can be made available [via data shipping.](https://dev.kevel.co/docs/beta-logs#userdb-logs) In addition to UserDB endpoints, userKeys and payloads, the logs can contain arbitrary **properties** set on the endpoints. These are key/value pairs that you can use to track metadata about the request (like a version number, for instance) that will persist after the request is complete. All UserDB endpoints support properties.

For example, if you wanted to track a version number and a nickname when a userKey is loaded via the azk cookie, you would append those via two `property:` query parameters:

HTTP

```http
https://e-1234.adzerk.net/udb/1234/set/i.gif?userKey=abc123&property:version=1&property:nickname=George
```

The resulting logs will include those properties:

JSON

```json
{
  "Meta:schema": "userdb",
  "Meta:version": "1.0",
  "NetworkId": 1234,
  "Timestamp": 1539104456290,
  "Action": "cookie",
  "UserKey": "abc123",
  "Properties": {
    "version": "1",
    "nickname": "George"
  }
}
```
