# Cookie criterion

{% hint style="warning" %}
The operators and tag check of this criterion were changed Early September 2025.&#x20;

If you have any doubt about the actual behavior of your Segments, read carefully the specifications below.
{% endhint %}

## Cookie criterion

The Cookie criterion is a segmentation criterion that enables defining a [segment](/assets-library/creating-and-managing-segments.md).

To learn how to create a segment, please refer to this [article](/web-experimentation-and-personalization/targeting-step/how-to-create-a-segment-who-section.md).

### 📖 Definition: <a href="#h_01hhpe4jcpe357mrtpgcehfs5j" id="h_01hhpe4jcpe357mrtpgcehfs5j"></a>

The Cookie criterion enables you to segment your audience based on the presence (or absence) of a specific cookie in the visitor’s browser.

### 🔎 How Does It Work? <a href="#h_01hhpcyeh3r9x758f97wt1cbn8" id="h_01hhpcyeh3r9x758f97wt1cbn8"></a>

In a campaign using the **Cookie** criterion, AB Tasty parses the Cookies storage to find the name of the cookie and its value:

<figure><img src="/files/kncLh5UUoSQMgBbdefRu" alt="" width="563"><figcaption></figcaption></figure>

### ⚙️ Configuration <a href="#h_01hhpe4jcpy9fdnmyynjkegdkb" id="h_01hhpe4jcpy9fdnmyynjkegdkb"></a>

You can select multiple operators for targeting a specific cookie and its value.

* `is` / `is not` : will accept/reject the visitors if they have a cookie in their browser with a specific name and value (string).
* `contains` / `does not contain` : will accept/reject the visitors if they have a cookie in their browser with a specific name and a value containing a specific sequence of characters (string).
* `is regular expression` / `is not regular expression` : will accept/reject the visitors if they have a cookie in their browser with a specific name and a value verified by the regular expression.
* `is lower than` : will accept the visitors if they have a cookie in their browser with a specific name and a numerical value strictly lower than the specified input.
* `is higher than` : will accept the visitors if they have a cookie in their browser with a specific name and a numerical value strictly higher than the specified input.
* `is between` : will accept the visitors if they have a cookie in their browser with a specific name and a numerical value strictly between the specified inputs.
* `is declared` / `is not declared` : will accept/reject the visitors if they have a cookie with the specified name in their browser or not.

{% hint style="warning" %}
If a cookie, specified in a condition using `is not`, `does not contain`, `is not regular expression` operators, is not present in the visitors' browser, they will be rejected from the campaign.

Example :&#x20;

* You have a cookie name `Internal_Team` with value `true` used by your coworkers
* External Visitors do not have a cookie `Internal_Team` with value `false` stored in their browser
* If you do a condition `Internal_Team` `is not` `true`, your coworkers will be rejected but so will be the visitors as the tag expects the specified cookie here.

⇒ In this case, you should exclude the visitors with the cookie without specifying the value and use `is not declared` operator.
{% endhint %}

You can also add another condition by clicking **`+Add condition`** below the criterion field. This action adds a condition line into the same section and allows you to add another cookie condition to your targeting.

In this case, you will have to choose ***which relation between your multiple conditions to apply*** for your targeting between **`some`** and `all`. Each time a new value is expected, you need to add a new condition (even if it is based on the same cookie).

<figure><img src="/files/u2Rzw1CgUrbXF8zXuBpG" alt="" width="563"><figcaption></figcaption></figure>

### 💡 Use case <a href="#h_01hhpe4jcpacd11gph9s838s3s" id="h_01hhpe4jcpacd11gph9s838s3s"></a>

The standard use case consists in creating an audience segment based on the presence of a CRM cookie.\
Let’s say you want to create a “VIP” segment in AB Tasty to create personalized messages for this visitor category on your website.

Your CRM pushes a cookie called **`RFM_segment`** for all web users, with different values:

* **`user_0`** for a prospect;
* **`user_1`** for a one-time buyer;
* **`user_2`** for a returning buyer;
* **`user_3`** for a very frequent buyer.

<figure><img src="/files/MEejbPSVJRbAocpkJIPI" alt="" width="563"><figcaption></figcaption></figure>

In the AB Tasty segment builder, go to the **Technology** category and drag and drop the **cookie** criterion into the segment creation section on the right side.\
Then select the **`is`** option and enter the **`user_3`** value, without double quotes.

**Need additional information?**

Submit your request at <product.feedback@abtasty.com>

Always happy to help!

<img src="/files/s6XXfNGFYKH6yl4B9NkH" alt="" width="146">


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.abtasty.com/assets-library/creating-and-managing-segments/list-of-segment-criteria/cookie-criterion.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
