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:
| Segment | Possible Values | Based On |
|---|---|---|
| Browser | Chrome, Firefox, Safari, Edge, Opera, Internet Explorer, Other | User agent |
| Device | All Phones, iPhones, Other Phones, All Tablets, iPads, Other Tablets, Desktops, Other | Device detection |
| Source | Campaign, Search, Referral, Direct | UTM parameters and referrer |
| Campaign | The utm_campaign value (if present) | URL parameters |
| Visitor Type | New, Returning | Session count |
| Country | ISO 3166-1 country code | Geolocation (loaded on demand) |
Source Detection Logic
| Condition | Source |
|---|---|
Has utm_campaign parameter OR medium is cpc google | Campaign |
Medium is organic | Search |
Medium is referral | Referral |
| None of the above | Direct |
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
/productspage - "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:
- The segment is placed in a waiting queue
- Additional data is requested from the CDN
- When data arrives, deferred segments are re-evaluated
- 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
Updated about 1 month ago