How a visit becomes a segment
How a visit becomes a segment. Eleven rules run in this browser from the viewport, the clock, stored visits, and the URL. Two of them change the home page call to action when consent is on.
The Segments lab runs eleven on/off rules in this browser and shows the values each one just read. Your segments updates as you resize, scroll, and open pages. Consented visitors counts profiles that hold a snapshot and does not show a visitor key. Why am I seeing this?, under the cards, names the two segments that can change the home page. The same panel sits beside the hero. The lab-menu entry for the rules on this page opens it from anywhere.
Mobile is on when window.innerWidth is under 760 pixels. Desktop is on at 1100 or wider. From 760 through 1099, both stay off. That property is the layout viewport, scrollbar included, so the rule follows the window rather than the User-Agent. Night owl is on at local hour 22, 23, or 0 through 4. Date.prototype.getHours() returns 0–23 in local time. The card's timezone is Intl.DateTimeFormat().resolvedOptions().timeZone, the runtime's time zone. Neither rule waits for consent.
Campaign visitor is on when the URL has utm_source, utm_medium, utm_campaign, utm_term, utm_content, or utm_id. Google's campaign URL guide documents those names, and others this site does not read. Values are cut at 120 characters. document.referrer is classed as direct, search, social, internal, or other and shown on the card. An empty referrer, which is a direct visit such as a bookmark, does not flip the segment. Signed-in member follows the session. It can be on while consent is off. The snapshot is written only while consent is on.
New visitor and Returning visitor read site.visitor.v1 in localStorage, storage for this origin that lasts until it is cleared. A flag in sessionStorage stops a refresh from counting as another visit. That store ends when the tab closes. The first consented session stores 1. Under 2, with consent on, is New visitor. Two or more is Returning visitor. Consent off does not read the count, so both stay off.
Engaged reader turns on after two notes reach 75% scroll, or fit the window: scrollHeight within 8 pixels of innerHeight. Depth is scrollY divided by the scrollable height. Dwell is printed and is not part of the test. This tab counts at once. Older notes load only with consent on. Lab explorer turns on at two paths that are /lab or start with /lab/, including earlier sessions when consent is on. The pathing count on the card is this tab's sequence in site.path.v1. It does not decide the segment.
West Coast and Other region call GET /api/edge-place only after consent. Vercel documents x-vercel-ip-country as a two-character ISO 3166-1 code and x-vercel-ip-country-region as the region portion of the ISO 3166-2 code for the public IP. West Coast matches CA, OR, or WA, or those full state names, when the country is blank, US, or USA. If the region header is missing, the zones America/Los_Angeles, America/Vancouver, America/Tijuana, and America/Whitehorse count instead. A region that is present, and is not one of those states, is not replaced by the timezone. Other region is on when some region or a non-UTC timezone is known and West Coast is off. Both stay off while the request is in flight. The headers describe the IP, which is the subject of Where the site thinks you are.
With consent on, a changed set goes to POST /api/segments after 400 milliseconds. The body is consent of granted and { id, on } for every id, including the ones that are off. The request sets keepalive, and a pagehide listener flushes a change still waiting. MDN says that event is not reliable on mobile, so the timer is the send that runs while the page is open. The route refuses Sec-GPC: 1. The Global Privacy Control specification requires that header value when the signal is on for the top-level page, exposed in script as navigator.globalPrivacyControl. Any other consent value is refused, unknown ids are dropped, and a body over 8,000 characters is rejected.
The snapshot is stored on the bbp.visitor profile. A missing cookie is set on the response: HttpOnly, SameSite=Lax, Path=/, Max-Age 400 days. Script cannot read it. How that differs from a script cookie is Why a first-party cookie forgets you. A signed-in session stores the account id beside the flags. The flags are not the history, the URL, or an email.
GET /api/segments returns the latest snapshot for each of the 2,000 most recently updated profiles, reused for about 30 seconds. Each bar is the share of those profiles with the segment on, rounded to the nearest percent. Those live figures are not repeated here. When the on-set changes, the page also pushes segment_update, a comma-separated list of the ids that are on. That list is the GA4 user property in From a push to a Google hit. The snapshot stays on this origin. Consent off stores nothing and leaves the page on the default.
Two segments change the call to action, and only while consent is on and the comparison control is Personalized. A consented reload starts there. Engaged reader sets the primary action to "Engaged reader · see the rule" and wins ahead of the scroll, returning-visitor, and campaign actions. Night owl sets the second action, otherwise "Read the notes," to "Night owl · see the segment," on top of whichever primary action won.
The home page panel lists the segments that are on and the winning rule for the hero, the call to action, the notes, and the layout. Default shows the baseline page without clearing storage. Personalized puts the rules back. With consent off, the panel says the rules were evaluated and were not applied. The header Why button is a separate control: labels beside each slot, kept across pages, stored as site.why.v1 when consent is on. The Why page explains it. The other nine segments are labels. Related rules read the same signals directly, which Personalization from the same signals walks through, and the personas lab runs them for five fixed visitors and for you.
Try it
- Open the Segments lab with consent off. The visit cards stay off. Resize across 760 pixels and across 1100. Mobile and Desktop trade places, and the band between them turns both off.
- Accept measurement and reload. New visitor or Returning visitor matches the stored count, and this browser joins the snapshot.
- Open a second path under
/lab. Lab explorer turns on. The pathing count can move without that. - Read two different notes past 75%, or two short notes that fit the window. Reload the home page. The primary action should name Engaged reader. Default restores the baseline label, and Personalized brings it back. During hours 22, 23, or 0 through 4, the second action names Night owl.
- Reload the lab with
utm_sourceset tonotes. Campaign visitor turns on. The same parameter can change the home page hero, and the panel names the segment and the rule.
Sources
- Window.innerWidth, MDN
- Date.prototype.getHours(), MDN
- Intl.DateTimeFormat.prototype.resolvedOptions(), MDN
- Document.referrer, MDN
- Window.localStorage, MDN
- Window.sessionStorage, MDN
- Window: pagehide event, MDN
- URL builders: Collect campaign data with custom URLs, Google Analytics Help
- Request headers, Vercel
- Global Privacy Control specification, W3C
Labs that show this
- See live audience segments
See live audience segments built from signals already in this browser, plus a count of consented visitors. The rules are on the page. No third-party profile.
- Why am I seeing this page
Why am I seeing this page? The header control labels each personalized slot with the rule and the signals that fired it. Free to turn on across the site.
- Same page, five people
Same page, five people, plus you. Each card names the signals and the rule that changed the hero, the offer, and the notes. Tweaks stay in this browser.
Recommended next
Why these picksReading path transitions…