# Tags

> Tags are text keys and values that your app writes on a person. Segments, REST targeting and in-app cards read them.

URL: https://docs.xulo.io/concepts/tags

A tag is a text key and a text value, such as `plan` = `pro`. Your app writes tags. Segments, the REST `tag` target and in-app cards filter on them.

## Tags live on the person

Tags belong to the person, the Xulo ID, not to one install. Every install of that person reads the same tags. A segment or an in-app card that filters on a tag matches the person's tags, even when one install never wrote that key.

## Writing tags

```swift
Xulo.setTags(["plan": "pro", "summary": "1"])
Xulo.addTag(key: "results", value: "0")
```

- `addTag` writes one key and keeps the others.
- `setTags` replaces the set of tags this install sends.
- On the server, keys that arrive overwrite the stored value. Keys that do not arrive stay as they were.
- An empty set of tags does not change the stored tags.
- `"0"` is a value, not a delete. A tag set to `"0"` is still there.

## Limits

An install sends at most 30 tags.

## Using tags

- In the dashboard, a saved segment can filter on one tag key and value. See [Segments](https://docs.xulo.io/concepts/segments).
- The REST API can target a tag directly, with an option to include people who do not have the key. The dashboard shows that audience as `Devices tagged "plan" = "pro"`, or `Devices tagged "plan" = "pro", plus devices that don't have this tag`. See [Targeting](https://docs.xulo.io/api/targeting).
- An in-app card can be limited to people with a tag. See [In-app cards](https://docs.xulo.io/concepts/in-app-cards).
