# Tutorials

## Table of contents

| Scenario                                                                |
| ----------------------------------------------------------------------- |
| [Example 1: Trigger Loyalty Action ](#example-1-trigger-loyalty-action) |
| [Example 2: New Participant Reward](#example-2-new-participant-reward)  |
| [Example 3: New Participant](#example-3-new-participant)                |
| [Example 4: Campaign Ended](#example-4-campaign-ended)                  |

## Example 1: Trigger Loyalty Action

In this example, we'll trigger a loyalty action when there is a new response in Google Forms.

### [Step 1: Get access to LoyaltySurf on Zapier](https://docs.loyaltysurf.io/integrations/zapier/..#getting-started)

Once logged into Zapier, click the **Create Zap** button on the sidebar menu.

{% hint style="warning" %}
**Note:**

* Only the LoyaltySurf team owner's campaigns will show up when you connect to Zapier. If you are setting the Zap up as a team member, you will need to connect to Zapier using the team owner's LoyaltySurf account.
* If you used Google to sign up for LoyaltySurf, you'll need to set a password before connecting to Zapier. Go to the [Sign In](https://app.loyaltysurf.io/signin) page and click "Forgot password" to create one.
  {% endhint %}

### Step 2: Set up the Zap trigger

For the **Trigger** step, type *Google Forms* and select **Google Form** from the dropdown menu. Then in the **Event** field, select **New Form Response** from the dropdown menu.

Your screen should now look like this:

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FEHrwWBqv7ENMkhcwC05w%2FTrigger%20Loyalty%20Action%20-%20Zapier%20-%20Google%20Chrome%202023-01-26%20at%205.10.38%20PM.png?alt=media&#x26;token=ebcfe150-a702-4752-9c43-d641875bd46f" alt=""><figcaption></figcaption></figure>

Press **Continue**, then select **Connect a new account**. In the appearing window, choose an account or sign in to continue to Zapier. Press **Continue** again, pick your form from the dropdown menu under the **Form** field, click **Continue,** and finally, click the **Test trigger** button.<br>

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2Fpe2xNtckqI5hhabWEmpL%2FTrigger%20Loyalty%20Action%20-%20Zapier%20-%20Google%20Chrome%202023-01-26%20at%205.32.23%20PM.png?alt=media&#x26;token=e2819013-176a-459e-bbbc-812d0122d68b" alt=""><figcaption></figcaption></figure>

You've now successfully set up the Zap to trigger when there is a new response in Google Forms. Now it's time to create the action for triggering a loyalty action using LoyaltySurf.

### Step 3: Set up the Zap action(s)

For the **Action** step, type *LoyaltySurf* and select **LoyaltySurf** from the dropdown menu. Then in the **Event** field, select **Trigger Loyalty Action** from the dropdown menu.

Your screen should now look like this:

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FWVE8KQQRZu0zu8O8mmfO%2FTrigger%20Loyalty%20Action%20-%20Zapier%20-%20Google%20Chrome%202023-01-26%20at%206.20.42%20PM.png?alt=media&#x26;token=ddd7fb8a-df2c-4c65-9094-f392d82848cb" alt=""><figcaption></figcaption></figure>

Press **Continue**, then select **Connect a new account**. In the appearing window, enter your LoyaltySurf login credentials. Press **Continue**, pick your LoyaltySurf campaign from the dropdown menu under the **Choose** field, then click **Continue**.

Here's what your screen should look like:

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FbtZbvFzBsPv9OLP1ntoZ%2FTrigger%20Loyalty%20Action%20-%20Zapier%20-%20Google%20Chrome%202023-01-26%20at%206.57.09%20PM.png?alt=media&#x26;token=5bcaa275-fdde-40ff-9d8f-393def4e5a48" alt=""><figcaption></figcaption></figure>

Fill in all the required fields, click **Continue** and then click **Test action**. You should see the expected message: "Successfully awarded loyalty reward."

{% hint style="info" %}
**Loyalty Action trigger not working?**&#x20;

* Double-check that the above information in the screenshot(s) matches what you set up in your Zap.&#x20;
  {% endhint %}

You've now successfully set up the Zap action. Click the **Publish Zap** bottom to finish, then click **Publish & Turn On**. Your Zap is now live and will trigger a loyalty action when there is a new response in Google Forms.

## Example 2: New Participant Reward

In this example, we'll connect LoyaltySurf to Coupon Carrier, letting us send a unique coupon to a participant when they reach a loyalty action goal.

### [Step 1: Click to get access to LoyaltySurf on Zapier](https://docs.loyaltysurf.io/integrations/zapier/..#getting-started)

Once logged into Zapier, click the **Create Zap** button on the sidebar menu.

{% hint style="warning" %}
**Note:** Only the LoyaltySurf team owner's campaigns will show up when you connect to Zapier. If you are setting the Zap up as a team member, you will need to connect to Zapier using the team owner's LoyaltySurf account.
{% endhint %}

### Step 2: Set up the Zap trigger

For the **Trigger** step, type *LoyaltySurf* and select **LoyaltySurf** from the dropdown menu. Then in the **Event** field, select **New Participant Reward** from the dropdown menu.

Your screen should now look like this:

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FohlFkDbZ1M35bsdHdghr%2FScreen%20Shot%202023-01-19%20at%207.12.24%20PM.png?alt=media&#x26;token=6c65af06-2c04-4ba5-8636-c8925e7c5083" alt=""><figcaption></figcaption></figure>

Press **Continue**, then select **Connect a new account**. In the appearing window, enter your LoyaltySurf login credentials. Press **Continue** again and pick your LoyaltySurf campaign from the dropdown menu under the **Campaign** field.

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FrNmtKSM6Y4oPUgVc5I3M%2FScreen%20Shot%202023-01-20%20at%205.58.03%20PM.png?alt=media&#x26;token=ec5ed2d0-4c2f-4baf-91d0-2daaa041a456" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Note:** If you don't see your campaign(s) in the dropdown options, please note that only the campaigns you are an owner of will appear here. If you are setting the Zap up as a team member, you will need to go back to step #1 and connect to Zapier using your team owner's LoyaltySurf account.
{% endhint %}

Click **Continue**, then click the **Test trigger** button.

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FTIbKc42BNeS7IzFhc0LG%2FScreen%20Shot%202023-01-20%20at%207.08.11%20PM.png?alt=media&#x26;token=217e4a72-e770-4ede-b9f2-331a611ed1ad" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
At the "Test your trigger" step, please note that sample data may not accurately reflect your campaign data. Sample data is only used to set up the Zap. When the Zap triggers for a live campaign, real data will be provided in the Zap.
{% endhint %}

You've now successfully set up the Zap to trigger on a new LoyaltySurf participant reward. Now it's time to create the action of sending the winner a coupon code.

### Step 2.5: Set up Zap Filters

Before proceeding, it's important to check if you require a Zap Filter, which acts as a checkpoint for your data flow, halting the process if specific conditions are not met. Answer the following question and follow the instructions if your response is "yes."

**Question 1: Is manual reward approval enabled for your campaign?**

{% hint style="info" %}
If manual reward approval is enabled for your campaign, two Zapier trigger events will occur: (1) when the reward is pending approval, and (2) when the reward is approved.
{% endhint %}

* **Step A:** Set up the Zap trigger, then add the Filter by clicking the **+** button and selecting **Filter** from the **Built-in Tools** section
* **Step B:** Choose *Reward Approved* from the first dropdown&#x20;
* **Step C:** Set the next field to *Exactly matches (Text)*
* **Step D:** In the last field, type `true` or `false`, based on your desired outcome. Rewards that are approved have *Reward Approved* as `true`&#x20;
* **Step E:** Test and continue

### Step 3: Set up the Zap action(s)

For the **Action** step, type *Coupon* and select **Coupon Carrier** from the dropdown menu. Then in the **Event** field, select **Send a Code Email** from the dropdown menu.

Your screen should now look like this:

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FSARoPdQb4hAAJLLHA5O6%2FScreen%20Shot%202023-01-20%20at%208.23.02%20PM.png?alt=media&#x26;token=c8ae3640-d7c8-4da2-b2bc-28ca086b1ebe" alt=""><figcaption></figcaption></figure>

\
Press **Continue**, then sign in. In the pop-up window, enter your Coupon Carrier API key. Press **Continue** again, select **Participant Email** from the drop-down menu under the **Email Address** field, and pick the preferred Coupon Carrier configuration in the **Configuration** field.

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FyPdx8xbyvX592a2C4gXc%2FScreen%20Shot%202023-01-20%20at%209.07.20%20PM.png?alt=media&#x26;token=c307eb7e-63fc-4ee6-9d89-61697738e34b" alt=""><figcaption></figcaption></figure>

Click **Continue**, then click the **Test action** button.

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FMlLGZligSG4JMAEovUkc%2FScreen%20Shot%202023-01-20%20at%209.35.05%20PM.png?alt=media&#x26;token=d0a51495-6095-4364-803c-9992e3fac520" alt=""><figcaption></figcaption></figure>

You've now successfully set up the Zap action. Click the **Publish Zap** bottom to finish, then click **Publish & Turn On**. Your Zap is now live and will send a coupon whenever a LoyaltySurf participant reaches a loyalty action goal and unlocks a reward.

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FTzBDP9MFJK6dlLZKnDui%2FScreen%20Shot%202023-01-20%20at%209.50.18%20PM.png?alt=media&#x26;token=99f287db-b173-4086-ae88-eb92e109cf7d" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Need multiple actions?**

You can use [Multi-Step Zaps](https://zapier.com/help/premium-features/#multi-step-zaps) to create multiple action steps in your Zap. For example, with the above Zap, you send a coupon via Coupon Carrier. You could chain an additional action, like 'get a notification in Slack', within the same Zap.
{% endhint %}

## Example 3: New Participant

In this example, we'll connect LoyaltySurf to HubSpot. Whenever a new participant is added to your LoyaltySurf campaign, we'll add/update them as a HubSpot contact.

### [Step 1: Get access to LoyaltySurf on Zapier](https://docs.loyaltysurf.io/integrations/zapier/..#getting-started)

Once logged into Zapier, click the **Create Zap** button on the sidebar menu.

{% hint style="warning" %}
**Note:** Only the LoyaltySurf team owner's campaigns will show up when you connect to Zapier. If you are setting the Zap up as a team member, you will need to connect to Zapier using the team owner's LoyaltySurf account.
{% endhint %}

### Step 2: Set up the Zap trigger

For the **Trigger** step, type *LoyaltySurf* and select **LoyaltySurf** from the dropdown menu. Then in the **Event** field, select **New Participant** from the dropdown menu.

Your screen should now look like this:

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FS7ZkkvglL5rMfcNjr3nD%2FScreen%20Shot%202023-01-20%20at%2010.24.01%20PM.png?alt=media&#x26;token=0ea7dae9-9540-4757-86bb-5e7c1362e9ab" alt=""><figcaption></figcaption></figure>

Press **Continue**, then select **Connect a new account**. In the appearing window, enter your LoyaltySurf login credentials. Press **Continue** again and pick your LoyaltySurf campaign from the dropdown menu under the **Campaign** field.

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FxnBWGveDiUr4VaR2qwkI%2FScreen%20Shot%202023-01-21%20at%209.32.31%20PM.png?alt=media&#x26;token=4b0891bf-5bb9-4dab-a4a1-47c77346919a" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Note:** If you don't see your campaign(s) in the dropdown options, please note that only the campaigns you are an owner of will appear here. If you are setting the Zap up as a team member, you will need to go back to step #1 and connect to Zapier using your team owner's LoyaltySurf account.
{% endhint %}

Click **Continue**, then click the **Test trigger** button.

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FP9YvB9XeZ9yeEyg459GO%2FScreen%20Shot%202023-01-21%20at%209.44.43%20PM.png?alt=media&#x26;token=dde55a45-afe0-4468-940b-4b5d5a49aaed" alt=""><figcaption></figcaption></figure>

You've now successfully set up the Zap to trigger on a new LoyaltySurf participant. Now it's time to create the action of adding/updating the new LoyaltySurf participant.

### Step 3: Set up the Zap action(s)

For the **Action** step, type *Hubspot* and select **HubSpot** from the dropdown menu. Then in the **Event** field, select **Create or Update Contact** from the dropdown menu.

Your screen should now look like this:

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FgYd0Cg8RnKQSkKiG03Lc%2FScreen%20Shot%202023-01-21%20at%209.58.32%20PM.png?alt=media&#x26;token=6159a8f0-b282-4fd5-b7a5-5c5455e15d44" alt=""><figcaption></figcaption></figure>

Press **Continue**, log in to your HubSpot account, select an account and click **Choose Account** and **Connect App**. Then, click Continue in the Contact Email field and select **Participant Email** from the insert data dropdown menu.

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FEXgpJGitHPpRCYq8RKja%2FScreen%20Shot%202023-01-23%20at%204.04.23%20AM.png?alt=media&#x26;token=f1c64821-4fef-41c0-8aaa-e4b858a4ef48" alt=""><figcaption></figcaption></figure>

Then populate any other fields you want to save to the HubSpot contact. Once you've filled in all the properties that you want to save to the HubSpot contact, click **Continue**, then click the blue **Test action** button.

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2F0cqgZwZJNGSEz5e8gqPX%2FScreen%20Shot%202023-01-24%20at%208.28.22%20PM.png?alt=media&#x26;token=e3169850-6d6d-4819-9439-ac9307ed3fa7" alt=""><figcaption></figcaption></figure>

You've now successfully set up the Zap action. Click the **Publish Zap** bottom to finish, then click **Publish & Turn On**. Your Zap is now live and will create/update new HubSpot contacts whenever a new LoyaltySurf participant is added.

{% hint style="info" %}
**Need multiple actions?**

[Multi-Step Zaps](https://zapier.com/help/premium-features/#multi-step-zaps) allow you to include multiple actions in one Zap. For instance, a new LoyaltySurf participant is synced to HubSpot in the example provided. However, an additional action, such as receiving a notification in Slack, can be added to the same Zap.
{% endhint %}

## Example 4: Campaign Ended

In this example, the outcome of the LoyaltySurf action campaign will be sent via email to your company's CEO once the campaign concludes.

### [Step 1: Get access to LoyaltySurf on Zapier](https://docs.loyaltysurf.io/integrations/zapier/..#getting-started)

Once logged into Zapier, click the **Create Zap** button on the sidebar menu.

{% hint style="warning" %}
**Note:** Only the LoyaltySurf team owner's campaigns will show up when you connect to Zapier. If you are setting the Zap up as a team member, you will need to connect to Zapier using the team owner's LoyaltySurf account.
{% endhint %}

### Step 2: Set up the Zap trigger

For the **Trigger** step, type *LoyaltySurf* and select **LoyaltySurf** from the dropdown menu. Then in the **Event** field, select **Campaign Ended** from the dropdown menu.

Your screen should now look like this:

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FOsBzRQwCezokZngZW2N4%2FScreen%20Shot%202023-01-24%20at%208.55.43%20PM.png?alt=media&#x26;token=9074c01a-2f1e-46a0-92dc-99305a54959e" alt=""><figcaption></figcaption></figure>

Press **Continue**, then select **Connect a new account**. In the appearing window, enter your LoyaltySurf login credentials. Press **Continue** again and pick your LoyaltySurf campaign from the dropdown menu under the **Campaign** field.

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FYDKHcS7EvRd5LWwg7ePz%2FScreen%20Shot%202023-01-24%20at%208.58.30%20PM.png?alt=media&#x26;token=996dc543-dbb2-4e07-9f9c-a9928ec6a010" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Note:** If you don't see your campaign(s) in the dropdown options, please note that only the campaigns you are an owner of will appear here. If you are setting the Zap up as a team member, you will need to go back to step #1 and connect to Zapier using your team owner's LoyaltySurf account.
{% endhint %}

Click **Continue**, then click the **Test trigger** button.

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FQpNAHLASwafpPRd3lodF%2FScreen%20Shot%202023-01-24%20at%209.03.46%20PM.png?alt=media&#x26;token=ef2febd6-86b8-41ff-a0ef-ae9cca38aa2c" alt=""><figcaption></figcaption></figure>

You have successfully set up the Zap to activate upon the conclusion of your LoyaltySurf campaign. The next step is to set up the action of sending an email.

### Step 3: Set up the Zap action(s)

For the **Action** step, type *Email by Zapier* and select **Email by Zapier** from the dropdown menu. Then in the **Event** field, select **Send Outbound Email** from the dropdown menu.

Your screen should now look like this:

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2F7K8bXD7BWVfI9V0IgKBT%2FScreen%20Shot%202023-01-24%20at%209.11.40%20PM.png?alt=media&#x26;token=cb42366a-afa2-496b-9b9b-28504f715f57" alt=""><figcaption></figcaption></figure>

Click **Continue** and type in the CEO's email in the **To** field. Then in the **Subject** field, type *Loyalty Action Campaign Results*.

In the **Body** field, add the following custom message with the appropriate `<Count>`s being added by clicking the insert data field and choosing an option from the dropdown menu.

> Hey Wilma,
>
> We just wrapped up our loyalty action campaign. Here are the results:
>
> * `<Campaign Participant Count>` total participants
> * `<Campaign Loyalty Action Count>` total loyalty actions
> * `<Campaign Winner Count>` total winners&#x20;

Here's what your screen should look like:

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2FnINrPglzZMDGkdpAYq4g%2FScreen%20Shot%202023-01-24%20at%209.27.38%20PM.png?alt=media&#x26;token=5f35ce25-2c3d-4faa-b96c-ba5c8d6d8e52" alt=""><figcaption></figcaption></figure>

Click **Continue**, then click the **Test action** button.

<figure><img src="https://3285719719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTwFF4MDnpq2eL5eyOdtK%2Fuploads%2Ft9tB3isVarcMGlyii9xe%2FScreen%20Shot%202023-01-24%20at%209.40.53%20PM.png?alt=media&#x26;token=c6ba44d4-e50a-4be5-9ee5-c608af5d225f" alt=""><figcaption></figcaption></figure>

You've now successfully set up the Zap action. Click the **Publish Zap** bottom to finish, then click **Publish & Turn On**. Your Zap is now live and will send out an email report when your LoyaltySurf campaign ends.

{% hint style="info" %}
**Need multiple actions?**

[Multi-Step Zaps](https://zapier.com/help/premium-features/#multi-step-zaps) allow you to include multiple actions in one Zap. For instance, in the example provided, an email is sent with the results of the LoyaltySurf action campaign to the company's CEO when the campaign ends. An additional action, such as receiving a notification in Slack, can also be added to the same Zap.
{% endhint %}
