WebmeticDocs
Get startedDetectEnrichPersonalizeIntegrateManagePartnersDevelopers

Session

A session is a visit to your website that Webmetic has assigned to a company.

For example, someone from Bergquell Mineralbrunnen reaches your website through a link on LinkedIn in the morning and reads the pricing page, a product page, and the contact page. That makes one session with three page views.

If the same person reads on in the afternoon, a second session starts. On the product pages of these docs, a session is called a visit.

When a session starts

Webmetic starts a new session in these cases:

  • A visitor views a page for the first time that day.
  • More than 30 minutes have passed since their last page view.
  • A new day begins, counted in UTC. In Germany that is at 1 a.m. in winter and 2 a.m. in summer.
  • The page address carries campaign parameters such as utm_source or a click ID such as gclid, and the source or medium differs from the previous page view.

For the campaign rule, a direct visit and a link from your own website don't count as a change. After 30 minutes or on a new day, a direct visit does start a new session.

Signals sent when someone leaves a page, for example about scroll depth, don't count as page views.

A session belongs to exactly one visitor, one website, and one Webmetic account. Subdomains such as shop.your-website.com count as the same website as your-website.com. No session runs past midnight UTC.

The API only returns sessions that Webmetic has assigned to a company. Visits after an opt-out are also missing, and so are new visits from companies you exclude with the domain blacklist or the organization types. Earlier visits of these companies stay in the API.

A session keeps its session_id when more page views are added later, so store sessions with the session_id as the key and overwrite existing entries.

Fields

FieldTypeExampleDescription
session_idstring"01M4WQFX6YM2X5V8T4N6R1C0DZ"ID of the session as a 26-character ULID. Sorts by start time and stays the same when page views are added.
client_idstringSee examplePseudonymized visitor ID, which changes daily and differs per account.
company_idstring"41ea486a9c95"The company of the visit. Only in /session.
company_namestring"Bergquell Mineralbrunnen GmbH"Name of the company. Only in /session.
timestampstring"2026-10-14T08:12:05.214000"Start of the session: the first page view, in UTC.
weburlstring"https://your-website.com"Protocol and host of your website, without a path.
utm_sourcestring"linkedin"Source of the visit, from the address or the referring website. "(direct)" when no source can be found.
utm_mediumstring"social"Medium of the visit. "(none)" when no source can be found.
utm_campaignstring"messe-2026"Campaign from the address of the first page view.
utm_termstring"mineralwasser"Term from the address of the first page view.
utm_contentstring"banner-oben"Content from the address of the first page view.
utm_campaign_idstring"4711"Campaign ID from the address of the first page view.
click_idstring"Cj0KCQjwx8a2BhD"Ad click ID from the address of the first page view.
click_typestringType of the click ID in click_id.
gcistring"1234567890.1728893525"Google Analytics client ID from your website's _ga cookie. Not a click ID.
gsistring"1728893525"Google Analytics 4 session ID from your website's cookie.
gsnstring"3"Google Analytics 4 session number from your website's cookie.
session_durationnumber309.0Length of the visit in seconds: from the first to the last page view, plus the time on the last page.
session_timenumber103.0Average time per page view in seconds, that is session_duration divided by the number of page views. Not the total length.
session_engagementnumber284.0Active time in seconds: the sum of the time the browser measured as active on each page. When that value is missing, the time until the next page view counts.
user_agent_browserobject{"family": "Chrome", "version": "130.0.0"}Browser with name and version.
user_agent_osobject{"family": "Windows", "version": "11"}Operating system with name and version.
user_agent_deviceobject{"family": "Other"}Device, plus brand and model when known.
user_agent_categorystring"desktop"Device class: "desktop", "mobile", "tablet", "bot", or "unknown".
visitor_citystring"Freising"City of the network the visit came from. Not where a person lives.
visitor_zipstring"85354"Postal code of the network.
visitor_countrystring"Deutschland"Country of the network, name in German.
visitor_country_codestring"DE"Country of the network as an ISO 3166-1 alpha-2 code. Can be missing even when visitor_country is set.
user_dataarrayThe page views of the session. Not in /session.
blurredbooleantrueOnly on the Free plan, for hidden companies in /session.

Source, medium, campaign, and click ID apply to the whole session and come from its first page view. For details, see Campaigns and channels.

Page views

The page views of a session are in user_data, a list of objects. Each object describes one page view with its address, title, time, and events. All fields are listed under Page View.

A session has no field for the number of its page views, so count the entries in user_data instead.

/session returns no page views. For those, use /session_user_data, which has one row per page view. Each row carries the session_id that links it to its session.

Fields per endpoint

EndpointOne rowSession fields
/sessionOne sessionAll fields with company_id and company_name, without user_data
/session_user_dataOne page viewOnly the session_id
/company-sessionsOne companySessions in sessions with user_data; company_id and company_name are on the company
/intensive-visits, /returning-visits, /new-visitsOne companySessions in sessions with user_data; every field is present, null without a value
Webhook eventsOne eventOne session in data.visit, with the same fields as the three endpoints above

In webhook deliveries, timestamps carry a Z; in API responses they don't. What sets the three visit types apart is described under Visit types.

Example

The visit started on https://your-website.com/pricing?utm_source=linkedin&utm_medium=social&utm_campaign=messe-2026 and had three page views.

GET /session
{
  "company_id": "41ea486a9c95",
  "company_name": "Bergquell Mineralbrunnen GmbH",
  "session_id": "01M4WQFX6YM2X5V8T4N6R1C0DZ",
  "client_id": "14e382cf709a614559666137b3d1dfcefa99b1e7ecf93400cc9e2cc4822619d3",
  "timestamp": "2026-10-14T08:12:05.214000",
  "weburl": "https://your-website.com",
  "utm_source": "linkedin",
  "utm_medium": "social",
  "utm_campaign": "messe-2026",
  "session_duration": 309.0,
  "session_time": 103.0,
  "session_engagement": 284.0,
  "user_agent_browser": { "family": "Chrome", "version": "130.0.0" },
  "user_agent_os": { "family": "Windows", "version": "11" },
  "user_agent_device": { "family": "Other" },
  "user_agent_category": "desktop",
  "visitor_city": "Freising",
  "visitor_zip": "85354",
  "visitor_country": "Deutschland",
  "visitor_country_code": "DE"
}

There were 245 seconds between the first and the last page view, and the browser measured 64 seconds on the last page. That makes a length of 309 seconds and 103 seconds per page view.

Edge cases

  • Missing values: In /session and /company-sessions, a field without a value is left out, but it can also be null. In the feeds and in webhooks, every field is present, as null without a value.
  • Time not measured: If there was no interaction on the last page and the browser sent no active time, Webmetic can't measure the time there. Webmetic then uses an estimate of a few seconds, in time_spent and in session_duration.
  • Order: /session and /company-sessions return sessions in no fixed order, so sort them yourself by timestamp or session_id. Within a row of the feeds, sessions run from oldest to newest. For details, see Pagination.
  • Time range: from_date and to_date filter by the start of the session, in /session_user_data too. For details, see Date ranges and time zones.
  • Several days: Because the client_id changes daily, you can't follow a visitor across several days. Link sessions through the company_id instead.
  • Free plan: For companies you can't see on the Free plan, a session in /session only has session_id, company_id, timestamp, a placeholder as company_name, and blurred: true. For details, see Plans.

Used by

On this page