Value types in analyses and filters
This article is a continuation of the Event and attribute operators article.
Once you define a logical operator in an analysis or a filter, you must define a value that will be used with the operator to check if the selected attribute or parameter meets the condition.
You can select the following value types:
If you want to analyze a parameter or an attribute in the filter or an analysis that is an array, you must use the Array operator. Then the field that appears next to the operator accepts the value of an array.
- If the array contains different data types (numbers, objects, arrays) it must be converted into a string and analyzed as a string.
- If you want to analyze occurrences of more than one string, you can do it in the following way:
The example below presents the condition in a metric that calculates the occurrences of an array that contains the
potato, steak value in the products parameter in a
A dynamic key is a condition whose value can be changed when the analysis is requested.
You can use a dynamic key to create a dashboard entirely dedicated for the analysis of a given aspect, for example, an item, a customer, a campaign, a brand, a product model, and so on.
How to create a dynamic key?
While preparing any analysis (except for aggregates, expressions, and dashboards):
- Select the property to test (profile attribute or event parameter)
- After selecting the property, next to the operator, click the icon until you get two fields: Dynamic key and Value.
- In the Dynamic key field, enter the source of the value for the dynamic key. The property will be compared with this value.
- use predefined dynamic keys.
- access event parameters in the following way:
- use any name for the key (no special characters, only letters and digits allowed). Such a key is only useful in dashboards, because dashboards allow you to enter a value manually.
- In the Value field, enter the default value.
This value is used:
- In Automation: if the parameter from the Dynamic key field doesn’t exist in the event/profile that is analyzed in the filter.
- In Dashboards: As the initial value of the dynamic key.
- Click Save.
You can use the dynamic key:
- when you create a dashboard and add this analysis, the Dynamic key button appears on the editing panel. Then, you can specify the value of the dynamic key or use the default one.
- in analytics such as profile filters in Automation.
In the above example:
- A mobile application adds the
newsletterTriggerparameter to events it sends. This parameter is the SKU of an item. This is a custom parameter invented for the purposes of this example
newsletterTriggerparameter changes periodically.
- A workflow is created to send a newsletter when a customer adds the required product to their cart.
- A “Profile filter” node is added to the workflow. In this node:
product.addToCartevent is analyzed.
- The value of the
skuparameter is tested.
- The value to test against is a dynamic key:
- The value is taken from the event’s
- If the parameter doesn’t exist, the default value (
NONE) is used.
- The value is taken from the event’s
- If the value of
skuin the event is the same as the value of
newsletterTrigger, the profile matches the filter.
Further nodes in the workflow send the newsletter to matching profiles.
The example below presents the condition of a metric that calculates the number of times a product was purchased. In this example, the
id dynamic key is created and it will be compared with the values sent through the
$sku parameter of the
product.buy event. At this stage, the default value of the dynamic key is not important in this analysis, so it’s set to
.. The result for this metric will be 0, but the metric will be added to the analytical dashboard (figure 10) in which the value of the dynamic key (the SKU of the item) will be defined and produce results.
This metric is added to a dashboard. In the Dynamic key field, you can enter a SKU and the dashboard will show metrics result for events in which the
$sku parameter was the same as the SKU you entered.
The numerical value is expected when you select the number operator and/or the event parameter or attribute is sent to Synerise in the form of a number.
The example below presents the condition of a metric that calculates the number of transactions above a specific value. In this example, the More than logical operator is used (the Number type operator) to narrow down the analysis to transactions where the monetary value was more than 100.
Currency is a separate parameter. This example shows events with
$totalAmount over 100 regardless of the currency.
As the value of the condition, you can indicate the value of another element created in Synerise.
The following list presents the types of elements you can use to compare with the values of event parameters and profile attributes:
- For event parameters:
- Specials (Timestamp),
- Expressions (event expressions for the event selected in the analysis/filter and all profile attribute expressions)
Tip: To check whether an expression is an attribute or event expression, go to Analytics > Expressions, find the expression on the list and go into its details. If the Expression for option is set to Attribute, it’s an attribute expression. Otherwise, it’s an event expression.
- For profile attributes:
How to select a parameter value
- After selecting an operator, next to the operator, click the icon until you get the Choose value button.
- Click Choose value.
- On the dropdown list, you can:
- Use the search box to find an element
- Select one of the following tabs: Tags, Attributes, Specials, Segmentations, Aggregates, Expressions. On the list, find the element you’re looking for.
The example below presents an aggregate that returns the list of last 100 IDs of transactions from the last 30 days which contain the products visited which were displayed in a defined recommendation campaign. The condition of the aggregate uses an aggregate that returns the SKUs of the clicked items within a particular recommendation campaign.
- Create an aggregate that returns the last visited recommendations in the defined time range.
- Create a new aggregate:
- Set the size of returned results to 100.
- Select the Consider only unique occurrence of the event parameter.
- Select the Bought product event.
- As the event parameter, select $orderId.
- After the $orderId parameter, add $sku parameter that occurs in the results of the aggregate from step 1.
This type of value allows you to enter a string of characters. It accepts special characters and spaces. Some features across the Synerise application allow usage of Jinjava/inserts in filters/analyses to retrieve a value out of another analyses like an aggregate, attribute, catalog, voucher pool, AI recommendations
How to select a string value
After you select an operator, it’s the default parameter/attribute value.
The screen below presents the condition of a metric: it calculates the first occurrences of the
newsletter.open event (an event which is generated when a profile opens an email) in a mobile channel. The is that the
source parameter of the event must include the string