# Source & source type criterion

***Source*** and ***Source type*** criteria are triggering criteria 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_01hhq2kg493pskkys7yj89wq55" id="h_01hhq2kg493pskkys7yj89wq55"></a>

***Source*** and ***Source type*** criteria enable you to trigger your campaign depending on the visitor origin.

* **The&#x20;*****Source*****&#x20;criterion is based on the source of the visit**. That is to say the **exact website** visitors come from.
* **The&#x20;*****Source type*****&#x20;criterion is based on source type of the visit**. It can be an organic, a referral or direct visit.

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

### Source type <a href="#h_01hhq2kg4aswd76dxmn339ms8h" id="h_01hhq2kg4aswd76dxmn339ms8h"></a>

The *Source type* criterion enables you to trigger your campaign when visitors are coming to your website from a specific source type:

| **Source type** | **Definition**                                                                                              |
| --------------- | ----------------------------------------------------------------------------------------------------------- |
| Organic         | Visitors coming from the links provided by search engines recognized by Google (Google, Bing, Yahoo, etc.). |
| Referral        | Visitors coming from another website (except for Social media).                                             |
| Direct          | Visitors who directly entered your website's URL in their browser to access the page(s) targeted.           |

***To include two source types, you can directly exclude the third one.***\
For instance, if you want to trigger your campaign when visitors are coming from a referral or an organic source, you need to exclude the *direct* source type.

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

On the contrary, if you want to exclude two source types, you need to include the third one.

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

### Source <a href="#h_01hhq2kg4ag26f8rp2rz1ty1zj" id="h_01hhq2kg4ag26f8rp2rz1ty1zj"></a>

The *Source* criterion enables you to trigger your campaign when visitors are coming to your website from a specific source determined by the referrer of the page.

Type **`document.referrer`** in the console to find it:

<img src="/files/XRkcn72ofO5FYg3eI8xu" alt="Checking document.referrer in console" width="563">

For instance, if you want to trigger your campaign when visitors are coming from Facebook, select `contains` > `Facebook`.

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

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

You can choose to trigger your campaign only when visitors are coming from Instagram in order to display a specific message to your Instagram followers and promote a specific game.\
To do so, select the *Source* criterion and select *contains* > *Instagram*.

People coming from other sources (Facebook, direct access, organic, etc.) won’t be included in the targeting and thus won’t see the contest.

## 🔎 How does it work? <a href="#h_01hhpyw4abkqmjd1yk9a78xfk5" id="h_01hhpyw4abkqmjd1yk9a78xfk5"></a>

We store the information and collect it from the browser. When a session is initiated, we store what is called the `referrer` page URL, communicated by the visitor's browser, inside the `ABTastySession` cookie. This information is collected only if one active campaign is using the “source type” trigger.

The different source types are defined as follows:

* **`Direct`**: if there is no referrer URL at all
* **`Organic`**: if there is any search engine reference inside the URL
* **`Referral`**: if any of the first two conditions are fulfilled

**Need additional information?**

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

Always happy to help!

<img src="/files/yWvWJB4myYeD6QJD788C" 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-triggers/list-of-trigger-criteria/source--source-type-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.
