# Setting up incentives email with Klaviyo

## Setting up the Shopify Flow integration

{% embed url="<https://www.youtube.com/watch?v=55JwiqL-9Ww>" %}

We will start by creating an automation triggered by the completion of a Gojiberry survey, and connecting it to a Track an Event Klaviyo action. Follow these steps to do so:

1. Open Shopify Flow, and create a workflow.

<figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXfHUBmemzwNc2lh6MY7nA5t-dC3UD9TkkyAhrCEioaFyhfPXERBfnbuYg_kAIoAUHIU9-OcKLasUieBL84Q-LbaopqM-nwIXd9zfqiKcRmyPKLBdrigON8JUSVwkD6woDKpDKuW2McYUnf9DKML2KiVWsqG?key=13gVNzDoDGtSQoJW35nNHg" alt=""><figcaption></figcaption></figure>

1. Select Gojiberry > Survey submitted as the trigger.

   <figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXd1KWXJrdE6dN423j61BNFW8-PBbpDKNCSmWrXBhblxkG0r1nMz8LfGuZG8Mo_NKWjCfMLupsJkHLdYKf01_C9LF_mwqlwjnHWDzCQsKe388ONbU0mug5pq3VS2n9uVqSDg2Tp8ju4Pd3IJ0uc2ABiCM5rL?key=13gVNzDoDGtSQoJW35nNHg" alt=""><figcaption></figcaption></figure>
2. Connect the Klaviyo > Track an Event action to your trigger.

   <figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXc72BHY4WNAZ6Bh0LmXK1jP6aCNwwKLDD0x7IeE0yEMi9SI8SexIczOuDdzW5e4jGP3os27q2QMh0QRR735QoeEccglV6C3Lp39hgDqfgw4UTmPXd94rnrSVfkU6CU-xyuAA7y_3sjHfPUI3EAPsBwEB-lz?key=13gVNzDoDGtSQoJW35nNHg" alt=""><figcaption></figcaption></figure>
3. Klaviyo has various text input fields. Fill them out as instructed below.

   <figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXfJyO5FzKrARWhDLgMe6lH7nv4yV0upcxnzRQL8HH9v8BY1gQCpR16AnDX2MPet0Q-x5O8H97HnDZHOtvJUzKMtCU3heClyayNox3w0Ex1QDU0VZVU4TLif5HRLjfnbaRXLotPGeRi4Bwp9vlg0dFIhjNU?key=13gVNzDoDGtSQoJW35nNHg" alt=""><figcaption></figcaption></figure>

<br>

| Klaviyo Public API Key | Open your Klaviyo account, and follow the instructions [here](https://help.klaviyo.com/hc/en-us/articles/115005062267) to obtain your public API key, and copy/paste it in.                                                            |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Event Name             | Enter any name you wish that is easy to identify. This will show up later when setting up the automated flow inside Klaviyo.                                                                                                           |
| Customer Email address | Input {{customer.email}}                                                                                                                                                                                                               |
| Customer First Name    | ※ not required                                                                                                                                                                                                                         |
| Custom Last Name       | ※ not required                                                                                                                                                                                                                         |
| Customer Properties    | ※ not required                                                                                                                                                                                                                         |
| Event Properties       | <ul><li>If you are using Gojiberry’s Discount code type incentive, input {"gojiberry\_incentive":"{{discountCode}}"}</li><li>If you are using Gojiberry’s Points type incentive, input {"gojiberry\_incentive":"{{points}}"}</li></ul> |

<br>

5. Click Turn on workflow > Turn on to save and activate Shopify Flow workflow.

   <figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXeFayOnLWrqg_yf9C1Z7Gu_Rjbv7jDrB-BERhpykuuEttU5rN_FL30nL1xBhjyLa4xUKG_e07VU9t4BrQ5czRI6Cve1kpY2JRfwe__dbBS-D6k51xyiSYi_yD5u0za0ePsvxFA-y9Z8szu2LjHIjOZhEsrx?key=13gVNzDoDGtSQoJW35nNHg" alt=""><figcaption></figcaption></figure>

## Setting up the Klaviyo flow automation

After setting up your Shopify Flow workflow, you will then need to set up the email to be sent Klaviyo as well. Follow these steps to do so:

1. Log in to Klaviyo, and then create a new flow by navigate to Flows > View All Ideas > Create From Scratch.

   <div><figure><img src="https://lh7-us.googleusercontent.com/6lC-sI9KflLTrTAtsCFs3mukOvlTuDm89uUxL1lwMiAOtUWYIGOxYNUZAqYyGIiobqfT4wY89ml_h1exsz4-_AzYPFZ9NqGG0IwH0CfQrDx8RiF-gOsEANfoCBug17_JDZSQutNje0ci-EYTJUXAuCs" alt=""><figcaption></figcaption></figure> <figure><img src="https://2859632820-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUvhqCYaEqce081raXRRA%2Fuploads%2FbbLE4jYPMdyUYn7ye00B%2Fklaviyo%206.png?alt=media&#x26;token=30f758b8-cc30-425d-a667-ab90cecc4458" alt=""><figcaption></figcaption></figure></div>
2. In your Klaviyo flow, find the event you created in Shopify Flow in Step 4. The Event Name you set in that step will show up underneath Your metrics > Shopify.

   <div><figure><img src="https://lh7-us.googleusercontent.com/4a4YaePp8sMTMQpJeyCjbIKRJqPrucaqKmChQHUU3oBGT5KSIFcFqV909hs9XV-McLvA5ZaBec28_Hjt5NyhcEtnTUJyGS0hZEHLLAm2dzX-13qgAxrpsBpQtX04BGu3b9rNMcro946LfctmDisumFo" alt=""><figcaption></figcaption></figure> <figure><img src="https://2859632820-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUvhqCYaEqce081raXRRA%2Fuploads%2Fk5l0gKZ46tAgbqclk8Gt%2Fklaviyo%207.png?alt=media&#x26;token=8629e500-c47f-42d4-ab89-e0a43b30f344" alt=""><figcaption></figcaption></figure></div>
3. After you set up your trigger, there will be a list of actions on the left. Drag the Email action to underneath your trigger.

   <div><figure><img src="https://lh7-us.googleusercontent.com/1bRq9VZF9gpRyRqO7AYHgLZDEriV34BHr_cL8yvJeBP6h14ZpQL1Elp0tnlZgtzoOMCeoDM79wwnEmGNiDa-NE4lThx9HZG52vegyrE37H8otsJv_vilycnEBR1gY6nL6WcvgaCfhrVCIQ_bkqOcGQU" alt=""><figcaption></figcaption></figure> <figure><img src="https://2859632820-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUvhqCYaEqce081raXRRA%2Fuploads%2FvgjeR72qNoQCbLlTMRdu%2Fklaviyo%208.png?alt=media&#x26;token=b84a09f9-a2fb-46dc-bbcf-43c712f2f87c" alt=""><figcaption></figcaption></figure></div>
4. Click on the email block and setup your email settings as you wish. For this tutorial, we will use a blank email template.

   <div><figure><img src="https://lh7-us.googleusercontent.com/1-JPgXjdsxjnAtcSImPv-NzMmMqosVFmpuNA3zkscgBArOkrWFy1_C17P8y46HPukRw0cD4gFpTZU6zd8MxZudoGjmJR9YJkAWftXCaTCMsWbxVLDhHWeyBBpMjHjbMeADZiSegnEIMxFW-sNYj02aI" alt=""><figcaption></figcaption></figure> <figure><img src="https://2859632820-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUvhqCYaEqce081raXRRA%2Fuploads%2F7lYv6vokKoWlXQRTQBeM%2Fklaviyo%209.png?alt=media&#x26;token=07c0da04-9616-429d-896e-a766a4eaf1cf" alt=""><figcaption></figcaption></figure></div>
5. In the email template, copy in the personalization variable {{ event.gojiberry\_incentive|default:'' }}, where the gojiberry\_incentive portion matches the variable name you set in the Event Properties in Shopify Flow in Step 4.

   <div><figure><img src="https://lh7-us.googleusercontent.com/LEJRP2QiamIOoA-YfqFoOhYwI7i3aE1lSUbVq09RolmSRNONJWOelNoJOVXBU0CsSNwnov39cXZAtX98WWecUlKVOlrbcFWvijxdwuks75eYeGz37N0SoZ9KsMCPTUIG1WnDJM1aUtvaG2bGj3UxZlo" alt=""><figcaption></figcaption></figure> <figure><img src="https://2859632820-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUvhqCYaEqce081raXRRA%2Fuploads%2Fa60FzKiZ8Wyz91jMi1rA%2Fklaviyo%2010.png?alt=media&#x26;token=73c3e19f-1eb8-41dd-a2bc-caf27f224e81" alt=""><figcaption></figcaption></figure></div>

<br>

6. When your email is ready, click Save and navigate back to the Flow page. Click Review and turn on to finish setting up your Gojiberry to Klaviyo integration.

   <div><figure><img src="https://lh7-us.googleusercontent.com/qfDROyEF3X77nlc61KXB5yWDIvYiRBKDTKgwmdt6LVSKxieWMEJskGNdkr35ZsDL8LsLxlqWZqxGjsJlZcHhLS8wEj_BFjSON10Kz2kDiDzlEEyk9lYRo2X_m2tzBDYGohWBlN4VcOGQbYEBf1McTjY" alt=""><figcaption></figcaption></figure> <figure><img src="https://2859632820-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUvhqCYaEqce081raXRRA%2Fuploads%2Ft48UDiAyiQruWNjpKBVw%2Fklaviyo%2011.png?alt=media&#x26;token=4c295cfc-904b-4a40-955b-00b05f52d9b3" alt=""><figcaption></figcaption></figure></div>
