> For the complete documentation index, see [llms.txt](https://docs.roivenue.com/roivenue-resources/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roivenue.com/roivenue-resources/implementation/web-data/roivenue-measurement/how-sessions-and-traffic-sources-are-determined.md).

# How Sessions and Traffic Sources Are Determined

How Roivenue Measurement turns the raw hits collected on your website into sessions, and how it decides the Source, Medium and Campaign each session is credited to.

Once Roivenue Measurement is running on your website, it sends a stream of individual hits: page views, page leaves, conversions and, if you track display, ad impressions. Roivenue does not report on those hits directly. It first groups them into sessions, and credits each session to a single Source, Medium and Campaign.

This page explains how that grouping works, which rule decides the traffic source, and how to read the result when it is not what you expected. If you are still setting up your tagging, read [UTM Parameters](/roivenue-resources/roivenue-training/core-concepts/utm-parameters.md) first. This page describes what happens to those tags after they reach Roivenue.

## From hits to sessions

A session is one continuous visit by one visitor. Roivenue closes the current session and starts a new one when either of the following happens:

* 30 minutes pass with no activity. The visitor's next hit after that gap starts a new session. This window is configurable per account, so check with your Account Manager if yours has been changed.
* The day ends. A visit that runs across midnight is split, so that every session belongs to exactly one day.

Everything else stays inside the same session, including clicking through several pages or coming back from a checkout step.

### How a visitor is recognised

Roivenue identifies a returning visitor using, in order of reliability:

1. the Roivenue cookie set in the browser,
2. a device identifier, when your implementation supplies one,
3. a user identifier, when the visitor is logged in and your implementation passes it.

Any one of these is enough to continue an existing session. When a visitor logs in part way through, the session keeps the user identifier they eventually supplied, so the visit is not split in two.

### Visits that cross your domains

If your site spans several domains, such as a shop and a blog, or a separate checkout domain, a visitor moving between them looks like two different visitors, because each domain has its own cookie. Roivenue can stitch those together into one session using the friendly domains configured for your account. When the referring page belongs to one of them, and both hits come from the same browser on the same device, the visit continues rather than restarting.

{% hint style="info" %}
If you see the same visit counted as two sessions with two different sources, typically the second one a referral from your own other domain, your friendly domains list is probably incomplete. Your Account Manager can extend it.
{% endhint %}

## The first hit decides the source

{% hint style="warning" %}
A session is credited to the traffic source of its first hit, and that credit never changes for the rest of the session.
{% endhint %}

If a visitor arrives from a Google Ads click and then, ten minutes into the same visit, clicks a newsletter link that carries `utm_source=newsletter`, the whole session still belongs to Google Ads. The newsletter tag is ignored, because the session was already open.

The same applies to conversions. A purchase is credited to the source that started the session it happened in, whatever the page URL looked like at the moment of purchase.

If you want that newsletter click credited separately, it has to arrive as its own session. It will once the 30-minute window has elapsed, or if it arrives on a later day.

```mermaid
flowchart LR
    subgraph S1["Session 1: credited to google / cpc"]
        direction LR
        A1["10:02<br>ad click<br>gclid present"] --> A2["10:12<br>newsletter link<br>utm_source ignored"] --> A3["10:20<br>purchase<br>credited to google / cpc"]
    end
    subgraph S2["Session 2: credited to newsletter / email"]
        direction LR
        B1["11:05<br>newsletter link<br>utm_source=newsletter"] --> B2["11:08<br>page view"]
    end
    A3 -.->|"45 minutes with no activity"| B1
```

The same newsletter link is ignored in the first session and decides the source in the second. What changed is the gap in front of it.

## How the Source, Medium and Campaign are chosen

For the first hit of the session, Roivenue works down the following list and stops at the first rule that matches.

```mermaid
flowchart TD
    A(["First hit of the session"]) --> B{"gclid present?"}
    B -->|yes| B1["UTM Source: google<br>UTM Medium: cpc"]
    B -->|no| C{"fbclid present?"}
    C -->|yes| C1["UTM Source: facebook<br>UTM Medium: cpc"]
    C -->|no| D{"utm_source tag present?"}
    D -->|yes| D1["UTM Source: the tag value<br>UTM Medium: utm_medium or (none)"]
    D -->|no| E{"Where is the referrer from?"}
    E -->|known search engine| E1["UTM Source: the engine<br>UTM Medium: organic"]
    E -->|another website| E2["UTM Source: the domain<br>UTM Medium: referral"]
    E -->|your own site, or no referrer| E3["UTM Source: (direct)<br>UTM Medium: (none)"]
```

The table gives the exact value each rule produces, including what happens when some of the tags are present and others are not.

| # | The landing URL or referrer contains…   | Source                                        | Medium                                      | Campaign                                         |
| - | --------------------------------------- | --------------------------------------------- | ------------------------------------------- | ------------------------------------------------ |
| 1 | a Google click identifier (`gclid`)     | `utm_source` if present, otherwise `google`   | `utm_medium` if present, otherwise `cpc`    | `utm_campaign` if present, otherwise `(not set)` |
| 2 | a Meta click identifier (`fbclid`)      | `utm_source` if present, otherwise `facebook` | `utm_medium` if present, otherwise `cpc`    | `utm_campaign` if present, otherwise `(not set)` |
| 3 | a `utm_source` tag                      | the `utm_source` value                        | `utm_medium` if present, otherwise `(none)` | `utm_campaign` if present, otherwise `(not set)` |
| 4 | a referrer from a known search engine   | the search engine, e.g. `google`, `seznam`    | `organic`                                   | `(not set)`                                      |
| 5 | a referrer from any other external site | the referring domain, e.g. `heureka.cz`       | `referral`                                  | `(not set)`                                      |
| 6 | a referrer from your own site           | `(direct)`                                    | `(none)`                                    | `(not set)`                                      |
| 7 | no referrer at all                      | `(direct)`                                    | `(none)`                                    | `(not set)`                                      |

Rules 1 and 2 are why a correctly tagged paid click is still recognised as paid when the UTM tags are missing entirely. The click identifier alone identifies the platform and sets the medium to `cpc`. For Google Ads the campaign and ad group are then filled in from the platform, as described below.

Rule 4 works from a built-in list of around 60 search engines, covering the global ones and the significant regional ones such as Seznam. A search engine outside that list is not recognised as search and falls through to rule 5, so its traffic appears as a referral from the engine's domain rather than as organic. If you see meaningful organic traffic classified as referral, tell your Account Manager which engine it is. The list can be extended.

For organic search, Roivenue also captures the search term when the engine still exposes it in the referring URL. Most large engines no longer do, so expect this to be empty for the majority of organic traffic.

### Google Ads fills in the campaign and ad group itself

If your account has Google Ads click data connected, Roivenue takes the campaign and ad group for `gclid` traffic from Google Ads rather than from the link tags. It looks the click identifier up in the click data downloaded from the platform, and writes the campaign and ad group it finds there into UTM Campaign and UTM Content.

This applies whenever a `gclid` is present. A link with no `utm_campaign` at all still reports the real campaign, and a link whose `utm_campaign` disagrees with the platform is corrected to the platform name. The lookup covers the previous 30 days of click data, so a click that led to a visit some days later is still matched.

UTM Source and UTM Medium are left alone, so the visit still reports `google` and `cpc` from rule 1 above.

Ask your Account Manager whether this is set up for your account.

### Where each tag ends up

| Tag on your link | Dimension in Roivenue |
| ---------------- | --------------------- |
| `utm_source`     | UTM Source            |
| `utm_medium`     | UTM Medium            |
| `utm_campaign`   | UTM Campaign          |
| `utm_content`    | UTM Content           |

UTM Content is where the ad group level belongs, following the tagging convention described in [UTM Parameters](/roivenue-resources/roivenue-training/core-concepts/utm-parameters.md). Roivenue treats it as the ad group throughout, so it is the dimension to break campaigns down by.

Alongside these, every session also carries a Device Category of `desktop`, `mobile`, `tablet` or `tv`, worked out from the browser. Traffic identified as automated is marked `robot`.

`utm_term` and `utm_id` are collected as well, but they are not part of the standard reporting set. Ask your Account Manager if you would like either added to your dimensions.

### Tags on the link beat values measured on the page

Roivenue reads the UTM tags from the landing page URL first. Only if the URL carries none of them does it fall back to values your implementation measured and sent with the hit.

{% hint style="info" %}
When a visitor arrives from another website, the landing URL is treated as the authority even if it carries no UTM tags at all. Values measured on the page are not used to fill the gap.
{% endhint %}

A visitor who genuinely arrives from an external site should be attributed to that arrival. Without this rule, a fresh organic visit could inherit the UTM tags of a paid campaign the visitor clicked two days earlier, or a value left sitting on the page.

## RID tagging replaces campaign names with the real ones

If your links are tagged with a RID (Roivenue identifier) parameter, Roivenue looks the identifier up against the campaign structure downloaded from the advertising platform, and replaces the campaign, ad group and ad names with the real ones used in the platform. This works for any platform that Roivenue downloads a campaign structure from, where the Google Ads lookup above covers `gclid` traffic only.

This takes priority over everything in the table above. The names then match the platform exactly, so there is no naming convention to maintain and no mismatch between what the UTM said and what the campaign is actually called. It also means the [Campaign (auto) dimension](/roivenue-resources/roivenue-training/core-concepts/campaign-auto-dimension.md) pairs web and platform data for you.

Talk to your Account Manager if you would like RID tagging enabled.

## Impressions are counted separately

Ad impressions and ad clicks collected through [impression tracking](/roivenue-resources/implementation/web-data/roivenue-measurement/impression-tracking.md) never form sessions of their own. An impression does not mean someone was browsing your site, so it neither extends a visit nor starts one.

Instead, Roivenue groups impressions per visitor and per traffic source, and reports them as their own rows with the touchpoint type Impression. They appear in path analysis and attribution alongside visits, carrying impression counts in place of page views, sessions and entrances.

## Reserved values you will see

| Value       | What it means                                                                                                                                                                        |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `(direct)`  | Roivenue could not identify where the visitor came from, because no referrer and no tags arrived. Typed URLs, bookmarks, untagged app and email clients, and QR codes all land here. |
| `(none)`    | No medium applies. Normal alongside `(direct)`, and expected when a link carries `utm_source` but no `utm_medium`.                                                                   |
| `(not set)` | The dimension was expected but no value arrived, most often a campaign link tagged with a source but no `utm_campaign`.                                                              |

`(direct)` is also used when the referring page is on your own site but the visit could not be connected to the earlier session. See the note on friendly domains above.

## What a session contains

Each session carries:

* Page views and hits: pages opened, and all tracked interactions.
* Sessions: one per visit, so visits can be counted once the data is aggregated.
* Entrances: how many distinct external sources brought the visitor in during the visit.
* Bounces: flagged when the visit had a single page view, no conversion, and lasted under a minute.
* Session duration: from the first hit to the last.
* Landing page: the path of the first page opened.
* Conversions, revenue and currency, when the visit converted.

### One visit can produce several rows

When a single visit contains more than one conversion, such as a purchase and a newsletter signup, or two separate orders, Roivenue reports one row per conversion. Every row carries the same visitor, the same timestamp and the same traffic source, with its own conversion value, so revenue is never double counted and each conversion can be attributed on its own.

Repeated conversions that arrive with the same conversion ID are treated as a duplicate measurement and counted once.

## Frequently asked questions

<details>

<summary>Why is so much of my traffic showing as (direct)?</summary>

`(direct)` means no referrer and no tags reached Roivenue. The usual causes, most common first:

* Untagged links in email, apps and messengers. Clients like Outlook, WhatsApp and native mobile apps frequently strip the referrer, and without UTM tags there is nothing left to identify the source.
* Links from secure pages to non-secure ones. Browsers withhold the referrer when moving from `https://` to `http://`.
* Missing tags on paid campaigns that also lack a click identifier.
* Offline entry points such as QR codes, printed URLs and typed addresses.

Tagging every campaign link is the fix, since a high `(direct)` share almost always comes from a tagging gap.

</details>

<details>

<summary>Why is my paid traffic showing as organic or referral?</summary>

The landing URL reached Roivenue without UTM tags and without a click identifier, so rule 4 or 5 applied and the referring domain decided the classification.

Check that auto-tagging is enabled in the advertising platform, that your final URLs still carry the UTM parameters after any redirect, and that a URL shortener or consent tool in between is not stripping the query string.

</details>

<details>

<summary>Why don't my session counts match Google Analytics?</summary>

Both tools sessionise, but they do not agree on the rules. Common sources of a gap:

* Mid-session source changes. GA4 can re-attribute a visit when a new campaign link is clicked inside it, where Roivenue lets the first hit decide.
* Cross-domain visits. Roivenue joins them using your configured friendly domains, GA4 uses its own linker.
* Internal traffic. Roivenue removes traffic matching your account's internal rules, such as office IP ranges, before reporting.
* Consent. Anything a visitor declines is not collected, and the two tools may depend on different consent categories.

A gap of a few percent is normal. A gap of tens of percent is worth raising with your Account Manager.

</details>

<details>

<summary>Why does one visitor appear as two sessions with different sources?</summary>

Either more than 30 minutes of inactivity passed between the two parts of the visit, the visit crossed midnight, or the visitor moved between two of your domains that are not configured as friendly domains.

</details>

<details>

<summary>A campaign is missing from my reports entirely. Where did it go?</summary>

Check in this order:

1. The links carry UTM tags, and the tags survive every redirect between the click and the landing page.
2. The traffic is not being removed by your internal traffic rules. An office IP range that has since been reassigned is a common cause.
3. Tracking is present on the landing page itself, not only on the rest of the site.
4. The campaign is not simply being reported under a different name than you expected, because the platform name and the `utm_campaign` value disagree. The [Campaign (auto) dimension](/roivenue-resources/roivenue-training/core-concepts/campaign-auto-dimension.md) page covers this case.

</details>

If something still does not add up after these checks, the [Implementation validation](/roivenue-resources/implementation/web-data/roivenue-measurement/implementation-validation.md) page shows how to verify what is actually arriving, and your Account Manager can look at the raw hits with you.
