# Number of sessions criterion

The Number of sessions 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_01hhpfe97q5m7w6vvp2ypnq5bf" id="h_01hhpfe97q5m7w6vvp2ypnq5bf"></a>

The “Number of sessions” criterion enables you to create an audience segment based on your users’ visit (or session) recurrence.

{% hint style="info" %}
A session ends after 30 minutes of inactivity.
{% endhint %}

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

The information comes from a specific `ABTasty` cookie. AB Tasty sets a value for each visitor in a specific variable (key is `ns` for the number of sessions). This variable is incremented each time a visitor is initiating a session when the session’s first page loads.

<img src="https://pf-emoji-service--cdn.us-east-1.prod.public.atl-paas.net/standard/caa27a19-fc09-4452-b2b4-a301552fd69c/64x64/1f449.png" alt="backhand index pointing right" data-size="line"> [See Consent policy, cookies and storages documentation](/account/performance-and-security/consent-policy---cookies-storage-and-privacy.md)

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

To use this criterion, drag and drop the **Number of sessions** label inside the middle column of the segment builder. You will have to choose from the following operators to configure your segment, which will determine the operation behind the value you will declare:

* **`is greater than`** means the visitor has to count **strictly more** sessions on the website than the number specified in the segment in order to be targeted.
* **`is lower than`** means the visitor has to count **strictly less** sessions on the website than the number specified in the segment in order to be targeted.
* **`is equal to`** means the visitor has to visit the **exact number** of sessions specified in the segment in order to be targeted.

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

You will then have to declare the appropriate value in the last field.

Let’s say a user visited your website **three times** this month. If you have created a segment based on a number of sessions **greater than** **3**, they will **not be included** in this segment. However, when they visit for the fourth time, they will be included in this segment.

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

This segmentation criterion is based on the AB Tasty cookie, which [collects ](#h_01GGCM9XJC1FM1G24AZAJKBWTT)and treats the navigation data. If the user clears their cookies, uses a new browser, another device, or the incognito mode to visit your website, they will be considered as a new user and AB Tasty will be unable to acknowledge them as part of the segment or to count their new session.

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

Basing yourself on the number of visits enables you to create segments related to your website’s traffic intensity. You can combine this criterion with others such as **Purchase Frequency**, for instance:

* Choose **Number of sessions** `greater than` **`5`**
* Then **Purchase frequency** `equals` **`0`**

Using this technique, you will target a segment of your visitor who is "very interested, but hesitant".

**Need additional information?**

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

Always happy to help!

<img src="/files/f4E7KTojJIIVhyltLO2t" 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/number-of-sessions-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.
