What is a segment?
A segment is a saved set of filtering rules. When a segment is assigned to an experiment, only visitors who match the rules are eligible for bucketing. Visitors who do not match see the default experience and are not tracked. Segments let you run targeted experiments — for example, testing a mobile layout only on mobile visitors, or running a campaign-specific landing page test only for visitors arriving from a paid ad.Creating a segment
Go to Segments → New segment in the sidebar. Give it a descriptive name, then add one or more rules.Available fields
Device detection
Device is determined by screen width at the moment the script runs:
Note that this is viewport width, not physical device type. A tablet in landscape mode may be classified as desktop. A desktop browser window resized to narrow width may be classified as mobile.
Operators
Combining rules
Rules within a segment can be combined with AND or OR logic:- AND — visitor must match all rules to be eligible
- OR — visitor must match at least one rule to be eligible
Segment examples
Mobile only
Paid Google traffic
utm_source=google&utm_medium=cpc in the URL).
Social traffic
Exclude direct traffic
Assigning a segment to an experiment
On the experiment Overview tab, use the Segment dropdown to assign a saved segment. You can change this at any time, even while the experiment is running. Changing a segment on a running experiment takes effect immediately for new visitors. Existing visitors who were already assigned retain their assignment regardless of whether they still match the segment.How segment evaluation works
Segments are evaluated client-side in the visitor’s browser, before any bucketing happens. The rules are evaluated on every page load using JavaScript:UTM persistence
UTM parameters are only present in the URL when the visitor first arrives from a link that includes them. If a visitor arrives via?utm_source=google on the first page, then navigates to a second page, the UTM parameters will no longer be in the URL on the second page.
This means segment evaluation works best on the landing page. If your segment depends on UTM parameters, make sure your experiment applies to the landing page itself (not a page the visitor navigates to afterward).
A future version will persist UTM values in a session cookie so they are available across the full visit.
Limitations
- No server-side fields — country, customer login status, purchase history, and Shopify Markets region are not available for segment rules. All evaluation happens in the browser.
- UTM values are not persisted — UTM parameters must be present in the URL at the time the page loads for the rule to match.
- Case-sensitive matching —
eqandcontainsare case-sensitive.utmSource eq Googlewill not matchutm_source=google.