# Goals

## Overview

Goals triggers cause a rule to be evaluated only once that goal’s own evaluation criteria has been satisfied. This means they introduce the concept of logic into a trigger, and allow you to set specified thresholds or conditions that you want a trigger to pass before a rule is evaluated.&#x20;

When you set up Goal triggers, you can choose whether you want to consider activities, awards or segments, as part of that evaluation:&#x20;

* **Activity-based goals:** can be as simple as the number of actions meeting some specified threshold, or more nuanced, like multiple separate actions meeting specified thresholds as defined by the logic implemented when creating the goal.&#x20;
  * Example: a goal could specify that a user must fulfill ten deliveries within a given time period for the goal evaluation criteria to be passed.&#x20;
* **Award & segment-based goals:** these function similarly to activity-based goals except they require a user to be in a segment, or have some defined number of awards. These types of goals can be set to run off scheduled evaluation frequencies to ascertain whether a meets the qualification criteria.&#x20;
  * &#x20;Example: a user must have over 10,000 points to pass the goal evaluation.

## Goal Types

### Cumulative Activity Goals

Activity goal triggers are evaluated based on the total number of activities that have occurred ever, or in a defined period, by a given user. They use basic logic operators like =, >, <, >=, <=. For instance, a goal could be successfully evaluated when a user completes more than 50 deliveries in a 7-day period.

{% hint style="warning" %}
**Note:** When a Cumulative Activity Goal is created, a user's Activities only begin begin counting toward that Goal from the moment it is created. \
\
For example, if you already completed 100 Activities, and you set the Cumulative Activity goal 50, the Goal will only trigger after the user completes another 50 Activities after the Goal is created.&#x20;
{% endhint %}

{% hint style="info" %}
**Action Goal vs Action Trigger:** Let's say I want to award $5 every time a user completes a trip. I would use a simple Action trigger "Trip Complete" to award $5 every-time a trip completes.&#x20;

Now let's say I only want to award a user the *first time* they complete a trip. I need logic to evaluate this. I'd use a Goal trigger, with logic "Trip Complete" = 1. Similarly I could award $5 only when the user completes 5 trips, where "Trip Complete" = $5.
{% endhint %}

### Cumulative Award Goals

Award goal triggers are evaluated based on whether a user has a certain number of awards. Again, they use basic logic operators like =, >, <, >=, <=.  For example, a goal could be reached when a courier has over 5,000 loyalty points or when a contractor has a 'gold-star' badge.

### Segment Goals

Segment goal triggers evaluate based on whether a user is in a segment or not. This can be either TRUE or FALSE. For example, a segment-based goal could be used to personalize a user's experience based on that segment, or otherwise evaluate a rule based on whether a user is in or out of one or more segments during a scheduled evaluation.

### Percentile Goals

* **Percentile action goals:** Percentile action goal triggers evaluate whether a user falls within a defined percentile of all users who have done a defined action in a given time period. For example, trigger a rule to distribute an award if the user is in the top 5% of customers based on total purchases made last week.&#x20;
* **Percentile award goals:** Percentile award goal triggers evaluate whether a user falls within a certain percentile of all users who hold a defined award (such as points or medallions). For example, a goal could be satisfied when a user is in the top 10% of all users based on total points held by those users.

## Creating Goal Triggers

You can create a new goal trigger by navigating to the Goal tab of the Triggers section. Here's an overview of the inputs required:

| Input                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Goal Name             | Enter a name for the goal. This may be user-facing, so choose a name that is identifiable for both external and internal users.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Goal Type             | <p>Choose from the following options. These are explained above. </p><ul><li>Cumulative Award Goal</li><li>Cumulative Action Goal</li><li>Percentile Award Goal</li><li>Percentile Action Goal</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Short ID              | This is the ID used in the Village database to identify a particular trigger. The short ID is auto-populated based on your Goal Name, but you also edit it if needed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Description           | This is an internal-only description of what this goal does. We suggest you are as specific as possible for other admin users to understand the goal logic.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Associated Users      | Note that you do not set associated users for a goal, but be aware that the goal inherits the associated users from its underlying action triggers, or based on the awards or segments that you specify in the goal's logic. Only these users will appear as available Recipients in any Rule that uses this goal.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Goal Requirements     | <p>This is where you set the logical conditions that need to be satisfied:</p><ul><li><strong>Qualification:</strong> the action, award or segment that is being evaluated.</li><li><strong>Logic:</strong> the operator that you want to use as part of the evaluation. These are >, <, =, >=, <=, TRUE or FALSE for segments, or a Top or Bottom rank for Percentiles.</li><li><strong>Threshold or Percentile:</strong> the number of activities or awards, or the percentile required to satisfy the logic.</li></ul><p>You can add multiple goal requirements as needed. Be aware that these are AND conditions, meaning all need to be satisfied for the goal to be satisfied overall. To create OR conditions, please create a separate goal.  </p><p></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Qualification Times   | <p>Action-based Goals (both Cumulative and Percentile) have Qualification Times. These let you specify a time period in which the goal requirements must be achieved. </p><p></p><p>For example, a user must complete 10 transactions <em>this month.</em> If not qualification time is specified, the goal will evaluate all actions, irrespective of time period. </p><p></p><p>You can specify both date and time restrictions, or create recurring qualification periods. </p><p></p><p>For more complicated qualification times, such as 6-9pm Thursdays and Fridays, use the 'Custom' time picker.</p><p><br></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Goal Evaluation Rules | <p>All goals require you to specify when the goal will be evaluated. As a reminder, this can occur in two ways: when an activity occurs (either on your platform, or as the result of another rule distributing an award or segment), and/or on a predefined schedule. </p><p></p><p><strong>For non-percentile goals:</strong> </p><ul><li>it's best practice to 'evaluate whenever a qualifying activity occurs.' This means the goal will be evaluated each time an associated action occurs, or award or segment is awarded. In effect, this goal will get evaluated in 'real-time' as stuff happens. </li><li>By default, you'll also need to set a scheduled evaluation time. Why? Because things may change in the background, for example like users entering or exiting segments or awards expiring that means a user no longer qualifies for a goal. This ensures there is logic running in the background that catches this. As a baseline, we recommend you set this daily at 12am. </li></ul><p><strong>For percentile goals:</strong></p><ul><li>Percentile goals can only be evaluated on a defined schedule, since by definition you are ranking users relative to their peers based on their behavior or awards held over a given time period. </li></ul><p><br></p> |
| Ongoing Qualification | <p>If you select "Require Ongoing Qualification," it means that whatever award or segment was issued to a user as a result of initially qualifying for a goal will be revoked if they no longer meet the qualification requirements.</p><p></p><p>As an example, if a rule with a goal-based trigger awards a status badge to the top 10% of shoppers by purchases, selecting ‘Require Ongoing Qualification’ means this status badge will be revoked if the user falls out of the top 10% of shoppers.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

{% hint style="info" %}
As a reminder, once you have created your goal trigger, you then need to create a rule that uses this trigger for any output operation to occur when the goal is satisfied.&#x20;
{% endhint %}

## Editing Goals

To edit a Goal, go to Triggers section, click on the Goals tab, and then click the "Edit" button. From there, you can update any of the fields set when creating the Goal.&#x20;

## Duplicating Goals

To duplicate a Goal, click the purple duplicate button on the right side of a Goal.

## Deleting Goals

To delete a Goal, click the "Delete" button. Please note that deleting a Goal is permanent and cannot be undone. You will not be able to delete a Goal when it is being used as part of an active rule. To do so first deactivate the rule, before deleting the Goal.

\ <br>
