# Alerts

Rules that check every scan, and the alerts they raise.


A rule describes a scan you want to hear about, such as a failed verification
or a bottle that turns up far from the shop that sold it. TAGBASE checks each
scan of your tags against your rules and lists every match under
**[Alerts](/dashboard/alerts)**. A pink badge next to Alerts in the sidebar
counts the alerts you haven't resolved.

## Create a rule

Open **[Rules](/dashboard/alerts/rules)** under Alerts and choose **Create
Rule**. Give the rule a name and, if you like, a description that tells your
team why it matters. The list of rules shows the description below the name.

Pick a template on the right of the dialog to fill in the rule:

- **Failed verification**: a scan fails, for example on a cloned tag.
- **Seal opened**: a tamper-evident tag reports its seal open or resealed.
- **Unusual scan volume**: someone scans one tag more than 10 times in 24
  hours.
- **Many countries**: people scan one tag in more than 2 countries in 24
  hours.
- **Scanned outside the Partner Country**: someone scans the tag in another
  country than the one on its linked record. TAGBASE names this template after
  your entity and its field, and offers it once one of your
  [entities](/docs/dashboard/entities) has a Country field.

You can change a template's values before you save, for example to allow more
scans.

## Conditions

A rule holds conditions, and a scan has to match all of them. You build each
condition from a field and a comparison, plus a value for most comparisons.

- **Scan**: status, seal, country, city, browser, and operating system.
- **Activity**: how often people scanned the tag, and in how many countries,
  in the last 24 hours, 7 days or 30 days.
- **Product**: the product's category.
- **Tag data** and **entities**: the fields of your categories, and the
  fields of the records your tags link to, such as a partner's country.

You can compare a country with another country field. That's how the partner
template works: it compares the scan's country with the partner's.

A field without a value only matches **is empty**, so a rule about the
partner's country stays quiet for tags without a partner.

## When TAGBASE checks a scan

TAGBASE takes a scan's country from the phone's location when the person
shares it, and from the internet connection otherwise. It waits for the
phone's location before it checks your rules, so country rules use the more
exact one. When the location arrives, the check runs at once. Without it,
TAGBASE checks after 10 minutes and uses the connection's country.

## Alerts

The alerts page lists which product tripped which rule, newest first, with
the scan's result and its time. Click a product to open the scan. The page
shows open alerts; switch to Resolved or All at the top.

Choose **Resolve** once you have looked into an alert. To resolve several,
tick their checkboxes and choose **Resolve Selected**. You find resolved
alerts under Resolved.

Switch a rule off to pause it and keep its alerts. Deleting a rule deletes
its alerts too.

