Operators in analyses and filters
Profiles and attributes
A profile represents an entity such as a person, organization, and so on. The summary of all data collected about a single profile is available in the Profiles module. In Synerise such actions as preparing most analyses, sending communication (email, text messages, web push notifications, mobile push notifications, and in-app messages), preparing promotions and recommendations, making predictions are profile-oriented.
An attribute describes a trait of a profile, for example, an email address, marketing agreements, size, age, favorite brand, results of aggregates and expressions, and so on.
Events and event parameters
Events describe actions that occur within your website or mobile application, such as page views (available in a workspace as page.visit
), clicks, and purchases. They are connected with profiles (for example customers) and they are generated as a result of implementing a tracking code into your website.
Events contain parameters, which are the details of the action they describe. Thanks to them, you can analyze events in terms of various aspects. For example, you can measure visits to a specific subpage within your website.
Operators
While creating an analysis or creating conditions for filters, you can base them on events, event parameters, and attributes. Operators allow you to describe a particular quality of an event parameter/attribute. Operators are grouped by the data type they are used with: string ( icon), number ( icon), boolean ( icon), array ( icon), and date ( icon).
The figure above is an example of grouping customers who visited a website that contained the shoe
phrase in the URL. This is done by creating a segmentation based on a page.visit
event and the uri
event parameter, and then choosing the String-type Contain
operator with the value shoe
.
Where can I find operators?
Operators can be found across the whole Analytics module in which you create analyses based on events, their parameters and profile attributes. Additionally, you can find operators in various filters across the application, for example on the list of profiles, while defining audiences for messages and automations, where the operators are used in Profile filters.
You can also find operators while defining filters within item feed, such as defining the filters for items to be displayed in AI recommendations.
Array
An array is an ordered collection of elements of the same or different type.
- If you want to operate on a value that is already an array of strings, no additional action is required to analyze the value.
- If the array contains different data types (numbers, objects, arrays) it must be converted into a string and analyzed as a string.
Converting arrays into strings
- Go to Analytics > Expressions > New expression.
- Set the Expression for option to Event.
Profile attributes can also be arrays. In such case, the Expression for option would be set to Attributes. - From the Choose event dropdown list, select an event whose parameter contains an object.
- Create the following configuration of an expression:
- Click the Select node.
- From the dropdown list, select Event attribute.
If it’s an attribute expression, select Profiles. - Click the Unnamed node.
- On the bottom, click Choose parameter button.
- From the dropdown list, select event parameter which contains the array that you need to convert into a string.
Only arrays of strings don’t need to be converted into strings before use in analytics. - Save the expression.
Result: You can select this expression as an event parameter which you can use in analyses and filters. In such case, you can use only the String operator type.
If you created an attribute expression, it can be used as an attribute in analyses and filters.
The Array operator type contains the following logical operators:
- Equal and Not equal - Choose these options to check if the attribute or parameter value is/isn’t exactly the same as the value you enter.
- Contain and Not contain - Choose these options to either include or exclude values that contain a specific phrase, respectively.
- Starts with and Ends with - Choose these options if you want to either include values that start or end with a particular string of characters.
- Regular expression - Choose this option if you want to analyze values of an event parameter that match a regular expression.
Boolean
This operator type is used in analyses/filters to verify whether an attribute/event parameter/event exists, the value of an attribute is false
or true
(string or boolean) or null
.
This operator type contains the following logical operators:
- Is true - Choose this operator to analyze event parameters and/or attributes whose value is
true
(string) or true boolean (attribute or parameter value sent to Synerise as a boolean value). - Is false - Choose this operator to analyze event parameters and/or attributes whose value is
false
(string), false boolean (attribute or parameter value sent to Synerise as a boolean value),null
, empty.
Date
This operator can be used only for event parameters and profile attributes whose value is a date/time string formatted according to ISO 8601.
While defining the condition for this operator type, you can select a date from a calendar. All the operators are meant to narrow the scope of dates considered in the general date filter of the analysis/filter.
This type contains the following logical operators:
-
Date - Choose this option to analyze an event parameter or an attribute in terms of a particular date (it can be a past date).
-
Custom - Choose this option to select a date range for analysis of an event parameter or an attribute.
Click here to see an exampleThe screen below presents a segmentation that groups profiles in terms of their date of birth. The conditions of the segmentation uses the Custom logical operator to define the date range for the birth date attribute.
-
Current date - This option lets you choose elements from the current date (the system takes into consideration the date of checking the result of the analysis).
- Matches current hour - The system considers only the event occurrences that happened at the hour of the current date within the given date range. Assuming the current date is the 28th of February, 2023, 11.30 A.M., then while previewing the analysis of page visits in the last 30 days, the system will return results for the page visit events that occurred for 30 days backwards, every day between 11:00:00 and 11:59:59 from the current date (28th of February, 2023).
- Matches current day - The system considers only the event occurrences that happened at the current day of the month. Assuming the current date is the 28th of February, 2023, then while previewing the analysis of page visits in the last 3 months, the system will return results for the page visit events that occurred on the 28th day of the month for 3 previous months.
- Matches current month - The system considers only the event occurrences that happened in the current month. Assuming that February is the current month, then while previewing the analysis of page visits in the last 3 years, the system will return results for the page visit events that occurred only in February of the previous 3 years (including current year).
Tip: You can check the usage of Matches current day and Matches current month operators in the Birthday email use case.
- Matches current year - The system considers only the event occurrences that happened in the current year. Assuming that the current date is the 28th of February 2023, then while previewing the analysis of page visits in the 6 months, the system will return results for the page visit events that occurred from current date backwards until the 1st of January, 2023 00:00:00.
Number
This operator can be used only for event parameters or attributes whose values are expressed as numbers (including those sent as a string). For example, you can create a following condition: size more than 8
(analyze the size
attribute whose value is higher than 8, which is 9, 10, and higher).
This type contains the following logical operators:
- Equal and Not equal - Choose these options to check if the attribute is or isn’t exactly the same as the value you enter.
- Less than and More than - Choose these options to analyze an event parameter or attribute whose value is lower or higher than the provided value (for example, for the following condition - the
size
attribute isMore than 8
, the results will contain entities whosesize
attribute is 8,01 or higher). - Less or equal to - Choose this option if you want to analyze an event parameter or attribute whose value is lower than or equal to the provided value.
- More or equal to - Choose this option if you want to consider the elements which are equal or bigger than the number you provide.
Object
If you want to analyze an object in the event parameters, that object must be converted into a string and analyzed as a string.
String
This operator can be used with event parameters and attributes whose values is a piece of text. For example,favoriteBrand equals XYZ
. This type contains the following logical operators:
- Equal and Not equal - Choose these options to check if the parameter/attribute value is or isn’t the same as the value you enter.
- Contain and Not contain - Choose these options to either include or exclude values that contain a specific phrase, respectively.
- Starts with and Ends with - Choose these options if you want to include values that start or end with a particular string of characters.
- Regular expression - Choose this option when you want to check if the value of an event parameter or attribute matches a regular expression.
- In and Not in - With these operators, you can check the string-type attribute or parameter against a comma-separated list of strings. The parameter/attribute value must be an exact match to one of the strings.
Examples:
- if the value of an attribute is
shoes
and the filter is Inshoes, shirts
, the attribute matches the filter. - if the value of an attribute is
shi
and the filter is Inshoes, shirts
, the attribute does NOT match the filter, because there is no exact match. - if the value of an attribute is
t-shirts
and the filter is Inshoes, shirts
, the attribute does NOT match the filter, because there is no exact match.Important:The list is ALWAYS split on a comma (
,
). Escape characters aren’t supported.
Example:- an event has an
itemTags
attribute with a string value:"garden,hobby"
- the filter is In
garden,hobby
Result:
The filter is split on a comma, soitemTags
is checked separately againstgarden
andhobby
. The attribute doesn’t match the filter, becausegarden,hobby
isn’t an exact match for any of the strings after the list is split.
If your attribute values contain commas, you can:- use the Equal/Not equal or Contain/Not contain operators to check against a single string.
- use the Regular expression operator to check against multiple strings:
For example, the regular expression(garden,hobby|sports,summer)
matches two attribute values:"garden,hobby"
and"sports,summer"
- an event has an
What’s next?
After you select an operator, you must define a value which you want to operate on.