Creating expressions
To create an expression based on mathematical formulas or calculations that becomes a customer attribute, follow the procedure.
Important: Segmentation, expression, and aggregate definitions are cached for 20 minutes after a node with the analysis is activated in a journey.
When another journey in the Automation requests a result of the same analysis in that period, the cached definition is used to calculate the results. This means that if you edit a segmentation, aggregate, or expression used in an Automation, it takes 20 minutes for the new version to start being used in journeys.
This includes definitions of segmentations, expressions, and aggregates nested in other analyses and used in Inserts.
When another journey in the Automation requests a result of the same analysis in that period, the cached definition is used to calculate the results. This means that if you edit a segmentation, aggregate, or expression used in an Automation, it takes 20 minutes for the new version to start being used in journeys.
This includes definitions of segmentations, expressions, and aggregates nested in other analyses and used in Inserts.
Requirements
- A tracking code implemented into the website.
Creating an expression
- Go to Analytics > Expressions > New expression.
- To let other users know about the purpose of the expression, you can add a short description to it.
- To select the type of expression you want to create, click the icon.
- From the dropdown list, select Attribute. In practice it means that you can use this expression in different types of analyses (for example, aggregates, funnels, and more).
- To start creating the formula of the expression, click the Select button.
- You can choose one of four elements: customer, constant, dynamic key, or a function.
- To define the settings of the chosen element, click that element.
- In case you choose a customer, from the Choose attribute dropdown, select the customer attribute you want to include in the formula.
- In case you choose a constant, type a number or text.
Important: It’s impossible to usenull
as an element of the condition. Thenull
value entered as a string will not ensure a desired result. - In case you choose a dynamic key, type in the key name (the ID of the key, for example
orderID
) and its default value. The default value will be replaced with the target one indicated in, for example, the request for expression result (when you request the expression result through Synerise Analytics API). - Define the dependencies between the elements in the expression by selecting the mathematical operators.
- To complete creating the expression, click Save.