> ## Documentation Index
> Fetch the complete documentation index at: https://help.maestra.io/llms.txt
> Use this file to discover all available pages before exploring further.

# How the Website Traffic Source Is Determined

Once the [JavaScript SDK](https://developers.maestra.io/docs/javascript-sdk) is installed on your site, Maestra Platform starts recording where every visitor came from. That's what lets you measure your marketing channels — campaigns, paid search, display advertising, and so on.

If the tracker can identify the customer on arrival, a **Website visit** action is created in their history.

If the customer isn't identified, their visits are stored for six months and then deleted. Once they're identified, those visits are pulled into their profile.

Every action — visits included — is tied to a touchpoint. For a visit, which touchpoint depends on how the person reached your site. Maestra Platform recognizes these traffic sources:

* Organic search
* Email click
* Social network
* Social advertising
* Paid search
* Display advertising
* Other advertising
* Referral
* Direct

<Note>
  To analyze traffic sources — comparing visitors, conversion, and revenue across them — use the **Website conversion** report.
</Note>

Here's how Maestra Platform processes a visit and works out which source it came from.

## Stage 1

The platform checks the link for UTM tags. If the link has them, it looks at `utm_medium`.

If `utm_medium` contains:

* **`cpc` or `ppc`** — the platform checks whether the link contains a domain it recognizes as a social network. If it does, the source is **Social advertising**. Any other domain makes it **Paid search**.
* **`display`, `cpm`, or `banner`** — **Display advertising**.
* **`email`** — **Email click**.
* **Anything else** — **Other advertising**.

For how the channel and touchpoint tree gets built from those tags, see [How channels and touchpoints are created from UTM tags](/customers-orders-and-products/actions/channels-and-touchpoints/channels/how-channels-and-touchpoints-are-created-from-utm-tags).

## Stage 2

If the request has no UTM tags, the platform checks whether the Referral URL is filled in.

The Referral URL is a request header that carries a link to the source of the request. Browsers fill it in automatically when someone follows a link to your site. You can see it yourself: open the developer panel, go to the **Network** tab, pick the request you're interested in, and open **Headers**.

If the Referral URL is filled in and there are no UTM tags, the platform reads its contents:

* Referral URL contains the domain of a search engine it recognizes → **Organic search**.
* Referral URL contains the domain of a social network it recognizes → **Social network**.
* Anything else → **Referral**.

## Stage 3

If the request has no UTM tags and no Referral URL, the source is **Direct**.

A missing Referral URL can happen when:

* The customer followed a link from an email client or an app (Outlook, a messenger, and so on).
* The customer opened your site from a browser bookmark.
* The customer copied or typed the address into the address bar manually.

Some sites run services that strip the Referral URL and put their own address there instead of the real source.

## How attribution works in the campaign summary report

This same logic decides which orders and clicks get attributed to your campaigns.

Attribution recalculates once a day. If it ran this morning and orders came in this afternoon, those orders won't reach your campaign reports until tomorrow.

An order is attributed to a campaign when all of this is true:

* The customer clicked a link in that campaign.
* The order landed inside the attribution window.
* Nothing interrupted them in between.
* They didn't cancel the order.

An **interrupting action** is a visit the customer made on their own, without clicking a campaign link first. Any traffic source counts — organic search, social network, display advertising, and so on. The one exception is **Direct**: a direct visit doesn't break the chain.

## Examples

Say your attribution window is two months.

| What happened                                                                                                                                                              | Result                                                                                                                                               |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| A customer clicks a link in your email and places an order inside the window.                                                                                              | <span style={{background:'#DCF0C4',color:'#3F6212',padding:'2px 10px',borderRadius:'12px',fontWeight:600,whiteSpace:'nowrap'}}>Attributed</span>     |
| Same click, but the order comes much later, outside the window.                                                                                                            | <span style={{background:'#FDF0CB',color:'#8A5A00',padding:'2px 10px',borderRadius:'12px',fontWeight:600,whiteSpace:'nowrap'}}>Not attributed</span> |
| The customer clicks your email, then comes back through Google search before ordering. That search visit interrupts the chain, even though the order is inside the window. | <span style={{background:'#FDF0CB',color:'#8A5A00',padding:'2px 10px',borderRadius:'12px',fontWeight:600,whiteSpace:'nowrap'}}>Not attributed</span> |
| The customer clicks your email, then comes back directly — from a bookmark, from Outlook. Direct visits don't interrupt, so the order still counts for the campaign.       | <span style={{background:'#DCF0C4',color:'#3F6212',padding:'2px 10px',borderRadius:'12px',fontWeight:600,whiteSpace:'nowrap'}}>Attributed</span>     |
