> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gameball.co/llms.txt
> Use this file to discover all available pages before exploring further.

# How Do I Use the Event Engine?

> Learn how to use the event engine when creating a reward campaign, referral program, or communication campaign.

Gameball Events Engine helps you set the reward campaign for one or more events your customer needs to complete. You can also add one or more rules per event with this engine.

<Frame>
  <img src="https://mintcdn.com/gameball/9WnFNxO9psy0HlAC/images/product-docs/rewards-campaigns/faqs/event-engine-overview.gif?s=a80053c7c9eefb24af74b4a234001d71" alt="Event engine overview" width="1772" height="910" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-overview.gif" />
</Frame>

The events engine is used in multiple cases, like creating communication campaigns, a referral program, or a reward campaign. You will need to use the event engine to set the events that a customer needs to do to trigger a campaign or achieve any of the mentioned programs.

<Frame>
  <img src="https://mintcdn.com/gameball/38fAhjsUX4jj3EkY/images/product-docs/rewards-campaigns/faqs/event-engine-use-cases.png?fit=max&auto=format&n=38fAhjsUX4jj3EkY&q=85&s=c59eabb1d0b73cb13182af8c00d5817f" alt="Event engine use cases" width="1696" height="742" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-use-cases.png" />
</Frame>

For additional information about events, see [Understand your customers' events](/product-documentation/understanding-your-customers/customer-profile), and [Manage your customers' events](/product-documentation/understanding-your-customers/customer-profile).

***

## Key Operators

For every chosen key in the case of using the event rule, you will find multiple operators based on the data type, which can be either numeric or string:

<AccordionGroup>
  <Accordion title="[String] Equals" icon="equals">
    <Frame>
      <img src="https://mintcdn.com/gameball/38fAhjsUX4jj3EkY/images/product-docs/rewards-campaigns/faqs/event-engine-string-equals-icon.png?fit=max&auto=format&n=38fAhjsUX4jj3EkY&q=85&s=0125f240c873224bddb4962595215565" alt="String equals operator icon" width="30" height="29" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-string-equals-icon.png" />
    </Frame>

    The received data from the customer for this key should equal a specific value (not case sensitive).

    **Use case: Buy from a specific collection or product**

    You can specify which product or collection a customer must buy from to meet the rule requirement.

    <Frame>
      <img src="https://mintcdn.com/gameball/38fAhjsUX4jj3EkY/images/product-docs/rewards-campaigns/faqs/event-engine-string-equals-example.png?fit=max&auto=format&n=38fAhjsUX4jj3EkY&q=85&s=f63178a7ad73dab10001be4dffa929a2" alt="String equals use case example" width="1880" height="474" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-string-equals-example.png" />
    </Frame>
  </Accordion>

  <Accordion title="[String] Different Values" icon="shuffle">
    <Frame>
      <img src="https://mintcdn.com/gameball/9WnFNxO9psy0HlAC/images/product-docs/rewards-campaigns/faqs/event-engine-different-values-icon.png?fit=max&auto=format&n=9WnFNxO9psy0HlAC&q=85&s=9214c690a89ee72c8bc453c26587ef16" alt="Different values operator icon" width="30" height="30" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-different-values-icon.png" />
    </Frame>

    This will allow you to configure the event to be completed in case Gameball receives X number of different types of data for this key.

    **Example:** User-defined key: Category to receive **3 different values**, the customer will complete this event if Gameball receives **Fashion**, **Electronics**, and **Accessories.**

    **Use case: Buy from 3 different collections**

    If you want your customers to meet a condition with multiple variables, such as to buy at least one product from 3 different collections, then the different values operator is what you need to use.

    <Frame>
      <img src="https://mintcdn.com/gameball/9WnFNxO9psy0HlAC/images/product-docs/rewards-campaigns/faqs/event-engine-different-values-example.png?fit=max&auto=format&n=9WnFNxO9psy0HlAC&q=85&s=468b41b64e5e32441dad75e9916f0e67" alt="Different values use case example" width="1642" height="470" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-different-values-example.png" />
    </Frame>
  </Accordion>

  <Accordion title="[Numeric] Equals or Greater Than" icon="greater-than-equal">
    <Frame>
      <img src="https://mintcdn.com/gameball/9WnFNxO9psy0HlAC/images/product-docs/rewards-campaigns/faqs/event-engine-equals-greater-icon.png?fit=max&auto=format&n=9WnFNxO9psy0HlAC&q=85&s=2dd699e0b34f538a3c9f5ead48dedbb2" alt="Equals or greater than operator icon" width="30" height="30" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-equals-greater-icon.png" />
    </Frame>

    The received number from the customer for this key should be greater than or equal to a specific value.

    **Use Case: Free shipping for orders over \$500**

    Grant a reward for when customers exceed a specific order value.

    <Frame>
      <img src="https://mintcdn.com/gameball/9WnFNxO9psy0HlAC/images/product-docs/rewards-campaigns/faqs/event-engine-equals-greater-example.png?fit=max&auto=format&n=9WnFNxO9psy0HlAC&q=85&s=89501ecb5b6f856a6a5652c7848241d2" alt="Equals or greater than use case example" width="1648" height="464" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-equals-greater-example.png" />
    </Frame>
  </Accordion>

  <Accordion title="[Numeric] Equals" icon="hashtag">
    <Frame>
      <img src="https://mintcdn.com/gameball/9WnFNxO9psy0HlAC/images/product-docs/rewards-campaigns/faqs/event-engine-numeric-equals-icon.png?fit=max&auto=format&n=9WnFNxO9psy0HlAC&q=85&s=e95fe3e123090b57bcc91d2a394eade5" alt="Numeric equals operator icon" width="30" height="29" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-numeric-equals-icon.png" />
    </Frame>

    The received data from the customer for this key should equal a specific value in numbers.
  </Accordion>

  <Accordion title="[Numeric] Accumulative Total" icon="chart-line">
    <Frame>
      <img src="https://mintcdn.com/gameball/9WnFNxO9psy0HlAC/images/product-docs/rewards-campaigns/faqs/event-engine-accumulative-icon.png?fit=max&auto=format&n=9WnFNxO9psy0HlAC&q=85&s=00ffb969f951a08a7cb4be64dc64acf9" alt="Accumulative total operator icon" width="30" height="30" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-accumulative-icon.png" />
    </Frame>

    The customer should reach a predefined number in one or multiple events for this key, and Gameball will store the received numbers till reaching the predefined number.

    **Use case: Get a 20% coupon after spending a total of \$1000**

    To create a rule where you want the customer to win a reward after they have spent a total of more than x amount (across all previous orders) you will need to use this operator.

    <Frame>
      <img src="https://mintcdn.com/gameball/9WnFNxO9psy0HlAC/images/product-docs/rewards-campaigns/faqs/event-engine-accumulative-example.png?fit=max&auto=format&n=9WnFNxO9psy0HlAC&q=85&s=ded6789f199d74daf6174e2b1d1661a7" alt="Accumulative total use case example" width="1534" height="402" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-accumulative-example.png" />
    </Frame>
  </Accordion>

  <Accordion title="[String] Contains" icon="magnifying-glass">
    <Frame>
      <img src="https://mintcdn.com/gameball/9WnFNxO9psy0HlAC/images/product-docs/rewards-campaigns/faqs/event-engine-contains-icon.png?fit=max&auto=format&n=9WnFNxO9psy0HlAC&q=85&s=a43ddddf1a2ab214cc75bcfb3e177963" alt="Contains operator icon" width="30" height="31" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-contains-icon.png" />
    </Frame>

    Include will be triggered if the key-value contains the added rule value, and the customer's event should satisfy the included value. For example, if your rule is to reward customers when they buy a certain type of product like "Summer shirts", "Summer accessories", you can just select all products that **include** the word "Summer".

    **Use case: Order includes an item from a specific collection**

    Let customers win a reward when they complete an order that has at least one item that belongs to a specific collection, while it does not matter what other collections are under the same order.
  </Accordion>

  <Accordion title="[String] Repeated Value" icon="repeat">
    <Frame>
      <img src="https://mintcdn.com/gameball/38fAhjsUX4jj3EkY/images/product-docs/rewards-campaigns/faqs/event-engine-repeated-value-icon.png?fit=max&auto=format&n=38fAhjsUX4jj3EkY&q=85&s=bfc3666553baa08e71dc4b6cac72e6b4" alt="Repeated value operator icon" width="30" height="30" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-repeated-value-icon.png" />
    </Frame>

    When using this operator, you are prompted to enter a string value for the key selected, then the number of repeated times which this reward campaign is won. This campaign will be achieved only when the customer meets the configured criteria for the number of repeated times indicated.

    By default, each new rule is set to be won for 1 time until the user changes it. The repeated number of times can be within the same event or cumulative.

    **Use case: Buy 3 items from a specific collection**

    You can create a rule where the customer has to buy 3 different items from the same collection using the repeated value operator.

    <Frame>
      <img src="https://mintcdn.com/gameball/38fAhjsUX4jj3EkY/images/product-docs/rewards-campaigns/faqs/event-engine-repeated-value-example.png?fit=max&auto=format&n=38fAhjsUX4jj3EkY&q=85&s=6de522eccc6e820883e509b0f997a941" alt="Repeated value use case example" width="1704" height="562" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-repeated-value-example.png" />
    </Frame>
  </Accordion>

  <Accordion title="Between" icon="left-right">
    <Frame>
      <img src="https://mintcdn.com/gameball/9WnFNxO9psy0HlAC/images/product-docs/rewards-campaigns/faqs/event-engine-between-icon.png?fit=max&auto=format&n=9WnFNxO9psy0HlAC&q=85&s=a5d76789fa4d1f59343a9f9a9b557e8e" alt="Between operator icon" width="50" height="34" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-between-icon.png" />
    </Frame>

    You can use a **between** operator when working with numeric attributes, allowing you to target customers who fall within a specific numeric range with greater accuracy.

    <Note>Minimum must be less than maximum.</Note>

    **Use case: Spend anywhere from 100 to 500**

    You can create a rule where the customer has to buy an order where the total price is between 100 and 500.

    <Frame>
      <img src="https://mintcdn.com/gameball/9WnFNxO9psy0HlAC/images/product-docs/rewards-campaigns/faqs/event-engine-between-example.png?fit=max&auto=format&n=9WnFNxO9psy0HlAC&q=85&s=99e410902c8ae06a7ced22c62e0edbac" alt="Between operator use case example" width="1672" height="422" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-between-example.png" />
    </Frame>
  </Accordion>
</AccordionGroup>

***

## The AND and OR Relation

You can also create multiple events. These are the relations you can set between those various events:

| Relation | Behavior                                                                                        |
| -------- | ----------------------------------------------------------------------------------------------- |
| **AND**  | The customer will have to complete **every event** to win the reward campaign.                  |
| **OR**   | The customer will have to complete **one of** the configured events to win the reward campaign. |

***

## Where You Will Use These Operators

<AccordionGroup>
  <Accordion title="Reward Campaigns" icon="gift">
    Reward campaigns mainly focus on how to reward your customers when they take certain actions on your platform, especially if you are [creating action-based reward campaign from scratch](/product-documentation/rewards-campaigns/start-from-scratch/create-action-based-reward-campaign).

    <Frame>
      <img src="https://mintcdn.com/gameball/38fAhjsUX4jj3EkY/images/product-docs/rewards-campaigns/faqs/event-engine-reward-campaign.gif?s=1e9fc40e7f012d0c81f55994a7582726" alt="Event engine in reward campaigns" width="1772" height="910" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-reward-campaign.gif" />
    </Frame>
  </Accordion>

  <Accordion title="Referral Program" icon="user-plus">
    The referral program motivates your customers to spread the word about your platform so you can increase your acquisition and grow faster. When a customer refers a friend, the friend has to first complete a specific action before they receive rewards. [Read more about the referral Program](/product-documentation/programs/referral-program).

    <Frame>
      <img src="https://mintcdn.com/gameball/38fAhjsUX4jj3EkY/images/product-docs/rewards-campaigns/faqs/event-engine-referral.gif?s=8151d041adc0c748672d6c9e40ccba59" alt="Event engine in referral program" width="1772" height="1380" data-path="images/product-docs/rewards-campaigns/faqs/event-engine-referral.gif" />
    </Frame>
  </Accordion>

  <Accordion title="Communication Campaigns" icon="bell">
    You can trigger communication campaigns based on customer actions, for example, when a customer visits a certain page on your website, they will receive a message that pushes them to take further action. [Read more about customer communication campaigns](/product-documentation/communication-campaigns)
  </Accordion>

  <Accordion title="Segment Creation" icon="users">
    You can create segments to target customers who fall within specific ranges based on the actions they made or the properties they have. [Read more about segment creation](/product-documentation/customer-segmentation)
  </Accordion>
</AccordionGroup>
