Creating event expressions

You can create an event expression to enrich its parameters while creating different types of analyses (for example, metrics, segmentations, funnels, and so on). This means that you can use the result of the event expression as a special parameter of an event in other types of analytics.

Tip: You can use these expressions as event parameters for events in the remaining types of analyses (for example, segmentations, metrics, funnels, and so on).

Requirements


A tracking code implemented into the website.

Procedure


  1. Go to Analytics icon Analytics > Expressions > New expression.
  2. To let other users know about the purpose of the expression, you can add a short description to it.
  3. To select the type of expression you want to create, click the Analytics icon icon. From the dropdown list select Event.
  4. From the Choose event dropdown, select an event.
  5. To start creating the formula of the expression, click the Select button.
  6. You can choose one of four elements: customer, constant, dynamic key, or a function.
  7. To define the settings of the chosen element, click that element.
    • In case you choose a customer, select the customer attribute you want to include in the formula.
    • In case you choose a constant, type the number or text (users can write a number in words, nine instead of 9).
    • 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).
  8. Define the dependencies between the elements in the expression by selecting the mathematical operators.
  9. To complete creating the expression, click Save.

Use case


Goal: To create a metric that counts liters of sold liquid products.

Prerequisites: Non-standard attributes for bought product event: product quantity and product volume. Instruction for adding event parameters available at the link.

Steps:

  1. Go to Analytics icon Analytics > Expressions > New expression.

  2. Enter the name of the expression.

    Note: The name of the event expression becomes also the name of the parameter of the event.

  3. Select Event as a type of expression.

  4. From the Choose event dropdown, select the Bought products event.

  5. Click the Select button.
    Result: A dropdown list appears.

  6. From the dropdown list select Event attribute.

  7. To display the settings of the event attribute, click it.

  8. From the Choose parameter dropdown, select quantity.

  9. Next to the added event attribute, click the plus button. Result: A dropdown list appears.

  10. From the dropdown list, select Event attribute.

  11. To display the settings of the event attribute, click it.

  12. From the Choose parameter dropdown, select volume.

  13. Multiply those two attributes, by selecting the multiplication sign between two event attributes.

  14. To complete, click Save.

    A final form of an expression
    A final form of an expression
  15. Go to Analytics icon Analytics > Metrics > New metric.

  16. Enter the name of the metric.

  17. As a type, select Simple metric.

  18. As the aggregator, set Count.

  19. As the occurrence type, set All.

  20. From the Choose event dropdown list, select Bought product.

  21. Click where icon button.
    Result: The Choose parameter button appears.

  22. Click the Choose parameter button.
    Result: A pop-up appears.

  23. On the pop-up, click the three-dot button.
    Result: A dropdown shows.

  24. From the dropdown, select Expressions.

  25. In the list of expressions, find the event expression you have just created.

  26. To select a specific time range, click the calendar icon. Confirm your choice with the Apply button.

  27. To complete the process, click Save.

A final form of a metric
A final form of a metric

Output: The metric counts the number of liters of purchased products in the form of a liquid from 6th of May to 6th of June. In this example, the number of purchased products is changeable, however, the product capacity is always the same and sourced from the product feed.

😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.