Optimize looks at the browser’s user agent string to identify which browser is being used, what version, and on which operating system. You can use these data as targeting criteria in Optimize.
In this article:Variables
The technology targeting variables are derived from the user agent string sent from a visitor’s browser (via the HTTP/GET request). Optimize looks at the user agent string and classifies it into one of the following groups. The Mobile Device Info variable corresponds to the ga:mobileDeviceInfo dimension in Google Analytics.
Browser
- Values (pre-defined)
- Chrome
- Firefox
- Safari
- Internet Explorer
- Opera
Operating System
- Values (pre-defined)
- Windows
- Mac
- Linux
- iOS
- Android
- Chrome OS
- Windows Phone
Device category
- Values (pre-defined)
- desktop
- mobile
- tablet
Mobile Device Info
- Values – Enter a value into this open text field to target users coming from a specific mobile device, for example:
Google Nexus 5
Match types – Browser, OS, and Device Category
The Browser, Operating System and Device Category variables use the following match types: equals, and does not equal.
Equals / does not equal
Every character, from beginning to end, must be an exact match of the entered value for the condition to evaluate as true. Primarily used in Geo and Technology targeting, a rule using the does not equal match type will evaluate as true when the visitor's browser, operating system or device category does not equal any of the entered values.
Example:
Variable | Match type | Value |
Browser | equals | Chrome |
Will evaluate true for:
-
Website visits coming from Chrome.
Variable | Match type | Value |
Browser | does not equal | Chrome |
Will evaluate true for:
-
Website visits coming from browsers other than Chrome.
Match types – Mobile Device Info
The Mobile Device Info variable uses the following match types:
- Equals / does not equal
- Contains / does not contain
- Starts with / does not start with
- Ends with / does not end with
- Matches regex / does not match regex
Equals / does not equal
An exact match of every character, from beginning to end, of the entered value.
Example:
Variable | Match type | Value |
Mobile Device Info | equals | Google Nexus 5 |
Will evaluate true for:
-
Website visits coming from the Google Nexus 5 device.
Variable | Match type | Value |
Mobile Device Info | does not equal | Google Nexus 5 |
Will evaluate true for:
-
Website visits coming from devices other than the Google Nexus 5 device.
Contains / does not contain
The contains match type (also known as a "substring match") allows you to target any occurrence of a substring within a longer string. Contains is useful when targeting an entire line of mobile devices.
Example:
Variable | Match type | Value |
Mobile Device Info | contains | Nexus |
Will evaluate true for:
- Website visits from any
Nexus
device.
Variable | Match type | Value |
Mobile Device Info | does not contain | Nexus |
Will evaluate true for:
- Website visits from any device without
Nexus
in its user agent string.
Example: Target users browsing on mobile devices
Technology targeting makes it easy to show experiment variations only to users browsing on mobile devices. Use the Device category variable to target mobile visitors to tell them about your mobile app. Target them with a variation of your app's landing page and test conversions against a download goal.
This rule will evaluate as true when a user visits your website from a mobile device:
Variable | Match type | Value |
Device Category | equals | mobile |
Example: Target users of specific browsers
Use the Browser variable to target users of specific web browsers. For example, you can include some browsers and exclude other older browsers, when testing a new web app.
This rule will evaluate as true if the visitor's browser is Chrome or Safari:
Variable | Match type | Value |
Browser | equals | Chrome or Safari |
Developer resources
- User Agent Strings (Chrome Developers)
Related targeting articles
- Introduction to Optimize targeting
- URL targeting
- Query Parameter targeting
- Audience targeting
- Behavior targeting
- Geo targeting
- Technology targeting
- First-party cookie targeting
- Data Layer variable targeting
- JavaScript variable targeting
- Custom JavaScript targeting
- Google Analytics Cookie Usage on Websites – Analytics Developers