Calculate Total Purchase Value
    • 1 Minute to read
    • Dark
      Light

    Calculate Total Purchase Value

    • Dark
      Light

    Article summary

    Goal

    To calculate the total value of all purchases a contact makes in your shop.

    Background Information​

    An operation is a type of profile-based automation. An operation consists of expression language applied to a profile attribute with the data type string, number or date. Use an operation to extract or modify data stored in an attribute.

    Procedure

    1. In ​Automation​, create an event-based automation to store the value of the contact's last purchase in a custom user attribute ​LastPurchaseValue​.

    2. In ​Administration​, create a new custom user attribute with the name ​TotalPurchaseValue​. The data type is ​Number​.

    3. In ​Automation​, create a new profile-based automation with the type ​Operation​.
      The target attribute is ​TotalPurchaseValue​.
      The operation has the following expression:

      ${user.CustomAttribute['LastPurchaseValue']+ user.CustomAttribute['TotalPurchaseValue']}

    4. Click the ​Save​ button.

    5. Select the profile-based automation and click the ​Activate​ button.
      ⇒ The profile-based automation is now active.

    6. Click the ​Apply Automations​ button.
      ⇒ Engage applies the automation to all contacts in the system. This can take a long time. An email notifies you when the automation is finished.

    Related Topics​

    ​Operations​


    Was this article helpful?