# Creating Achievement

***

## Adding achievement

In order to create the achievement, follow the following steps:

{% stepper %}
{% step %}
Go to the **Achievements** module
{% endstep %}

{% step %}
Click **ADD ACHIEVEMENT** in the top right corner
{% endstep %}

{% step %}
Choose **Start from Scratch,** **Use a template** or **Import achievements**
{% endstep %}

{% step %}
Define **Basic information, RULE (or Rules),** and set **Limit** (optional)
{% endstep %}

{% step %}
Set **Achievement status** to **Active**
{% endstep %}

{% step %}
Click on ADD ACHIEVEMENT.
{% endstep %}
{% endstepper %}

### Start from scratch

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FIfTnZPWEMET9KA0xurpx%2Fimage.png?alt=media&#x26;token=be0833b3-f737-4961-bd1c-3af4eefa4e40" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="success" %}
**Start from scratch achievement how-to**

1. Fill in [**Basic information**](#basic-information) in the <mark style="color:purple;">**①**</mark> **Achievement info** (remember to set Status to Active)
2. Click **Continue**
3. Set the <mark style="color:purple;">**②**</mark> **Rules** of your Achievement
4. Click **Continue** to review the configuration **in the** <mark style="color:purple;">③</mark> **Summary**
5. Press **Add Achievement.**
   {% endhint %}

### **Use a template**

In this option, you can choose a predefined configuration for internal testing, a specific use case for your loyalty program, or inspiration for the future scenario. You can edit then if you need minor changes of goals, achievement counting, limits etc.

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FOpp7V0tIbJQfsW6SXDtt%2Fimage.png?alt=media&#x26;token=d1b8d7cb-a6d3-47c5-9ca8-8e888e340a39" alt="" width="563"><figcaption></figcaption></figure>

### Import achievements

With this option, you can import achievements to Open Loyalty in a JSON file. For more reference, please visit [Achievement export/import.](https://help.openloyalty.io/main-features/managing-achievements#achievement-export-import)

{% hint style="success" %}
**Importing achievement/s how-to**

<img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FhRyMLrNcF0Lv37swKmdS%2Fimage.png?alt=media&#x26;token=5d9b8c4a-b0e2-42a4-b80d-c2efadabd11e" alt="" data-size="original">

1. Go to **Achievements**&#x20;
2. Click **Add achievements -> Import achievements**

After clicking this button you will see the pop-up window to upload the JSON file

<img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FvrNWPg7UwH6kYxGkW5FO%2Fimage.png?alt=media&#x26;token=d1f7b8f2-ef88-4762-87c4-33342a05cde2" alt="" data-size="original">

3. Follow the instructions from the popup window.
4. Click **IMPORT** to download the file with achievements
5. After importing, the achievement you will see the list of all successful and/or achievements that require the action to edit.
   {% endhint %}

***

## Achievement elements

### Basic information

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FbnaLTgllo1bWKbU4ebvL%2Fimage.png?alt=media&#x26;token=f422adc9-1deb-49ec-829c-0b3bf9743073" alt=""><figcaption></figcaption></figure>

* **Name** - Name of the achievement.&#x20;
* **Short description** - Description of the achievement.
* **Timeframe** - Timeframe of the achievement activity. Conditions available in this section are based on the Open Loyalty Language. If None is selected, the achievement is always active (If the Active field is set to True). With Timeframe, you can set the achievement to be active only on certain days of the week, such as Monday, Wednesday, and Friday.

***

### Rules

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2F99JQvzFa14I7dKI82cnz%2Fimage.png?alt=media&#x26;token=47efae8b-a56a-4ef2-9485-b4e0bb47923a" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
You can set up to 6 rules in the achievements.

![](https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FCjKJEFMyAtWjeFph53p6%2Fimage.png?alt=media\&token=ee3cb645-9473-4448-a66b-e8e4d692cc95)
{% endhint %}

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FxNKIoo3bEtCs7mPWSWVL%2Fimage.png?alt=media&#x26;token=11814441-6919-4eaf-93f4-d9096444bfd2" alt=""><figcaption></figcaption></figure>

#### **Rule basic settings:**

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FDOdpiNcSowRawts9LJT4%2Fimage.png?alt=media&#x26;token=219c0af6-02e3-44de-99dc-1d7be419ae27" alt=""><figcaption></figcaption></figure>

#### **Achievement type:**

|            Direct achievement            |                                                Referral achievement                                               |
| :--------------------------------------: | :---------------------------------------------------------------------------------------------------------------: |
| Achievement directed to a single member. | Achievement directed to a member (referrer) and friend (referee). The rules are set for the referrer and referee. |

#### **Achievement trigger**:

|                           Transaction                           |                                   Custom event                                   |
| :-------------------------------------------------------------: | :------------------------------------------------------------------------------: |
| Achievement responds to system events based on the transaction. | Achievement responds to custom events based on a predefined custom event schema. |

#### **Achievement counting:**&#x20;

|                                    Number of event occurrences                                    |                                 Number of specific event attributes                                |
| :-----------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------: |
| Determines the number of occurrences of the trigger required to achieve/complete the achievement. | Determines the value of the attribute of the trigger required to achieve/complete the achievement. |

#### **Event frequency limit -** determines how the goal will be counted.&#x20;

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FogWRyUBSf5b3hXQ5BRS9%2Fimage.png?alt=media&#x26;token=8b14f98e-5177-4a0c-b21f-ef8831755705" alt=""><figcaption></figcaption></figure>

Example: The member needs to place 4 transactions over 1 month, but only one order per week.&#x20;

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FCvzRBpCImPrc2TfBUo33%2Fimage.png?alt=media&#x26;token=a35215de-6793-4776-8874-03fede8d723f" alt="" width="563"><figcaption></figcaption></figure>

#### **Achievement goal -** determines the goal of the achievement

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FOF29G0L4esFUiFXUSqsy%2Fimage.png?alt=media&#x26;token=b3bc3507-7e8e-430c-8b7d-0140dc2eabfe" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}

* **Occurrence** - determines the time interval/manner in which the trigger should occur Overall,  Last X days, or Consecutively.
  * **Overall** - The events that can occur at any occurrence.
  * **Last X days -** events that occurred in the last  X days.
  * **Streak (day, week, month, year) -** Sequential events in a period. If the achievement has a goal with consecutive days/weeks/months, the Open Loyalty also checks the actual date when the event ends up in the Admin Panel. It’s crucial to send custom events from the oldest to the current date for correct achievement progression.
* **Goal -** determines the goal of the achievement.
  * *Example: "Need to perform an action at least 2 times per week for 2 consecutive weeks."*
  * In the **Referral achievement**, the goal corresponds to the number of referees. Each referee needs to complete one transaction - this section allows you to define whether the goal applies to the single referred user.
    {% endhint %}

#### **Track Unique Values**

You can track unique values of custom event attributes.\
For example, if you're monitoring progress based on 5 new events, you can choose to track only unique values from a specific attribute (included in the custom event data).\
There’s no need to predefine the list of possible values — progress will be counted only when a new, previously untracked value appears. This tracking is done separately for each member.

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FsZDA7IodGVISBj2p9E2N%2Fimage.png?alt=media&#x26;token=9e0adb93-60ee-4b4f-8ee3-db87ee947c5d" alt=""><figcaption></figcaption></figure>

#### **Trigger Condition**

The section allows you to define additional conditions for a given achievement trigger. For Transactions, these are conditions limited to the transaction context object. e.g. transaction.purchasePlace. For CustomEvent, these are the parameters specified in the custom event schema. [`Expressions`](https://help.openloyalty.io/main-features/expressions) can also be used to set the condition.

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FXlh7arjpmSeoH9kusRgE%2Fimage.png?alt=media&#x26;token=a423f3ee-6ecc-43d9-90a5-2404d494a107" alt=""><figcaption></figcaption></figure>

***

### Limits&#x20;

This option sets a limit on the amount of completion of an achievement.

The limit can be set by:

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FgBEmotcV4uTmZvkZwtMh%2Fimage.png?alt=media&#x26;token=de7bf180-25c9-4566-8290-8edf93862c0a" alt=""><figcaption></figcaption></figure>

* Unlimited
* Periods (per hour, day, week, month year),&#x20;
* In total&#x20;

The periods in the limit are counted on a calendar basis, this means that:

* Days are counted from 00:00:00 to 23:59:59
* Weeks are counted from Monday to Sunday
* Months are counted from the first to the last day of the month
* Years from January 1 to December 31<br>

### Achievement status

For the achievement to work, it's crucial to activate it before saving settings.

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2F3Gx2SNPmU8Xr8go71fKV%2Fimage.png?alt=media&#x26;token=25008f37-49d3-4807-8d3d-075b5c297d24" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
If you want to edit the settings after members start participating we advise you to create a new Achievement. In the case of editing any of the rule sets, all member progress will be lost.
{% endhint %}

***

## Learn more about

<table data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><a href="broken-reference"><strong>Achievement progressed campaign</strong></a></td><td>Discover how to set a campaign based on achievement progress</td><td></td></tr></tbody></table>
