Segments

Overview

Segments categorise visitors into groups based on their attributes and behaviour. The tracking script generates default segments automatically and evaluates custom segments you define in the Convert UI.

Default Segments

These are generated automatically for every visitor:

SegmentPossible ValuesBased On
BrowserChrome, Firefox, Safari, Edge, Opera, Internet Explorer, OtherUser agent
DeviceAll Phones, iPhones, Other Phones, All Tablets, iPads, Other Tablets, Desktops, OtherDevice detection
SourceCampaign, Search, Referral, DirectUTM parameters and referrer
CampaignThe utm_campaign value (if present)URL parameters
Visitor TypeNew, ReturningSession count
CountryISO 3166-1 country codeGeolocation (loaded on demand)

Source Detection Logic

ConditionSource
Has utm_campaign parameter OR medium is cpc googleCampaign
Medium is organicSearch
Medium is referralReferral
None of the aboveDirect

Device Detection

The device segment is an array — a visitor can match multiple device types. For example, an iPhone visitor matches both "All Phones" and "iPhones".

Custom Segments

Custom segments use the same rule engine as audience targeting. You define rules in the Convert UI, and the tracking script evaluates them for each visitor.

Examples:

  • "Power users" — visitors with more than 10 sessions
  • "Mobile shoppers" — mobile device AND visited /products page
  • "EU visitors" — country in [DE, FR, IT, ES, NL, ...]

Custom segments are stored in the visitor cookie and persist across sessions.

Deferred Segment Evaluation

If a custom segment rule requires data that isn't immediately available (geographic location, weather), the segment is deferred:

  1. The segment is placed in a waiting queue
  2. Additional data is requested from the CDN
  3. When data arrives, deferred segments are re-evaluated
  4. If a segment matches, any experiences targeting that segment are re-evaluated too

Segments API

Reading Segments

// Get auto-generated default segments
convert.getDefaultSegments();
// { browser: 'CH', devices: ['DESK'], source: 'SEARCH', campaign: '', visitorType: 'RETURNING', country: 'US' }

// Get all segments (default + custom)
convert.getVisitorSegments();
// { ...defaults, customSegments: ['100123', '100124'] }

Manual Segment Placement

You can manually place a visitor into a segment, bypassing rule evaluation:

window._conv_q = window._conv_q || [];
window._conv_q.push({
  what: 'placeVisitorIntoSegment',
  params: { segmentId: '100123' }
});

The segment must exist in the project configuration. Manually placed segments are persisted in the visitor cookie.

Re-Evaluating Segments

If segment conditions depend on dynamic data (page content, data layer values):

// Re-check segments waiting for additional data
window._conv_q.push({ what: 'checkSegments' });

// Re-check a specific segment with retry (max 10 attempts, 50ms intervals)
window._conv_q.push({ what: 'checkSegmentLooped', params: { segmentId: '100123' } });

Using Segments in Targeting

Segments can be used as targeting conditions for experiences via the In Segment rule type. This lets you create experiences that target specific visitor groups:

  • Show Experience A only to visitors in the "Power users" segment
  • Show Experience B only to visitors NOT in the "EU visitors" segment

Notes

  • Default segments are regenerated on each page load
  • Custom segments persist in the visitor cookie across sessions
  • A visitor can belong to multiple custom segments simultaneously
  • Segment membership can trigger re-evaluation of deferred experiences