User Agent Order Segmentation

This article describes how to configure Aurora to tag orders with additional fields based on the customers browser User Agent.

Introduction

When an order is created, Aurora can interrogate the customers browser User Agent and tag the order using additional fields based on a defined set of rules.

📘

The browser User Agent is a text value sent by a users browser on each request to Aurora that contains information about the users device, operating system and browser i.e.

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/604.3.5 (KHTML, like Gecko) Version/11.0.1 Safari/604.3.5

The above user agent was sent to Aurora by a Safari browser from Mac OS running on an Apple MacBook Pro.

These rules can be configured from within the Aurora Back-end, under Store > Settings > Aurora > Orders > User Agent Order Segmentation as seen below:

2278

Each rule contains the following values:

FieldDescriptionLengthExample
SearchA case insensitive regex pattern to match against the browser user agent. Where an invalid regular expression is entered, the rule will be ignored on order creation.

Regex patterns can be used for simple text searching such as "iphone" or more complex expressions such as the following:

iphone|iPad - Match phone or iPad. A pipe (|) represents an "OR" operator and can be used to search for more than one text value.

iphone.*safari - Match "iphone" followed by "safari". A period (.) represents any character and an asterisk (*) represents any number of occurrences of the previous character. This can be used to match more than one text value in sequence.
0-32iphone
Order Additional Field NameThe name of the additional field to be used when the search pattern is matched; this will be created where it does not already exist.Where an empty field name is entered, no additional field will be created should the rule match.0-32
Order Additional Field ValueThe value to be stored within the defined additional field.Where an empty field value is entered, an empty value will be created for the defined additional field name.0-32

Once an order has been tagged, the order additional field values can be seen on the View Order page under the Additional Fields tab and can be searched for using the Advanced Search on the All Orders page.

🚧

User Agent Order Segmentation rules are applied on order creation and as such, rules will only be applied to orders that are placed after a rule is added.

📘

User Agent Order Segmentation rules are always applied in sequence and in the order that they appear within the backend UI; this is important when defining multiple rules for the same additional field that may be matched against the same User Agent, for example a Chrome browser User Agent will contain both chrome and safari keywords, whereas a Safari browser user agent will only include the keyword "safari".

By defining a rule to match safari followed by another rule (for the same additional field) to match chrome, all orders placed using Chrome and Safari browsers are tagged by the safari rule, and then Chrome browsers only are retagged by the chrome rule.