> For the complete documentation index, see [llms.txt](https://docs.getmesa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getmesa.com/connect/klaviyo.md).

# Klaviyo

## Connection <a href="#connect" id="connect"></a>

When you're setting up your first workflow with Klaviyo, you'll need to create a connection through MESA's Klaviyo App to finish the process. If you are not already logged in, you will be asked to log in and select the Klaviyo account that you want to connect.

<figure><img src="/files/FJf4rMq6pSmZ0wv1vIzh" alt="Screenshot of the MESA Klaviyo App connection setup, log in and select the Klaviyo account you want to connect. Spotlight the account selection."><figcaption></figcaption></figure>

Afterward, you can re-use the newly created connection and select it for your future workflows!

## Configure <a href="#configuring" id="configuring"></a>

### Create Event action <a href="#event" id="event"></a>

MESA's Klaviyo Create Event action lets you create a new event to track a profile's activity. This is especially helpful if you want to add events whenever something happens in Shopify.

**This action has several required fields that you must fill in.**

1. **Metric** > **Name**

The Metric's Name field is the name of the new event added to the profile's activity. In the screenshot below, our event's name is "Placed Order".

<figure><img src="/files/7enLVPb3vF5rI5drJj5g" alt="Screenshot of the MESA Klaviyo Create Event action, Metric Name field set to Placed Order. Spotlight the Metric Name field."><figcaption></figcaption></figure>

You can also [choose "Insert variable" to add a custom Metric Name](https://docs.getmesa.com/workflow-builder/fields#drop-down-menus).

2. **Properties**

Properties are extra information that you'd like to add to the new event. You can think of Key as a label or description title of the extra information, while Value is the extra information you want to send.

In the screenshot below, we send the Shopify customer's ID as the Value with a Label called "customer\_id".

<figure><img src="/files/QekE7hx8d2uJVihp0w8Y" alt="Screenshot of the MESA Klaviyo Create Event action Properties, Key set to customer_id and Value set to the Shopify customer ID. Spotlight the Properties Key and Value fields."><figcaption></figcaption></figure>

3. **Profile's Email or Phone Number**

When selecting an existing profile, you must fill out the Profile's Email or Phone Number field so that Klaviyo can identify the correct profile to update.

<figure><img src="/files/JZ2hxfIQqNBvWgGQVrg7" alt="Screenshot of the MESA Klaviyo Create Event action, Profile&#x27;s Email or Phone Number field used to identify an existing profile. Spotlight the Profile&#x27;s Email or Phone Number field."><figcaption></figcaption></figure>

You cannot add multiple variables in the field. You must select only one variable.

4. **Profile > Email**

If you create a new profile, you will want to input an e-mail address for the user profile. In most cases, you will probably want to use a [MESA variable representing a profile's email address.](/workflow-builder/fields/variables.md)

In the screenshot below, we selected the variable representing a Shopify customer's email address for the Email field.

<figure><img src="/files/qK5MTYJAbaxjifiRLDiP" alt="Screenshot of the MESA Klaviyo Create Event action, Profile Email field set to the variable for a Shopify customer&#x27;s email address. Spotlight the Email field."><figcaption></figcaption></figure>

### Adding Profiles to a List <a href="#list" id="list"></a>

MESA provides two different actions for adding people to a Klaviyo list. There are key differences between these two actions: Add Profile to List and Subscribe Profile.

* **Add Profile to List**: This lets you add people directly to a Klaviyo list without offering consent. Adding a person to a list does not change their subscription status.
* **Subscribe Profile**: [If a Klaviyo list has double opt-in enabled](https://help.klaviyo.com/hc/en-us/articles/115005251108), people will receive a message requiring their confirmation before subscribing. Otherwise, people will be immediately subscribed without receiving a confirmation message. This will remove any [unsubscribe, spam report, or user-suppressed suppressions from the person's profile.](https://help.klaviyo.com/hc/en-us/articles/115005246108#what-is-a-suppressed-profile-1)

To summarize, if you're trying to obtain [consent](https://help.klaviyo.com/hc/en-us/articles/360037101072) to receive email marketing, SMS marketing, or both, we recommend using MESA's **Subscribe Profile** action in your workflows.

## Technical Notes <a href="#flow" id="flow"></a>

### Using MESA Track Events in a Klaviyo Flow <a href="#flow" id="flow"></a>

Switch to your Klaviyo Flow to begin including your MESA track events.

#### Start a Klaviyo flow with a MESA Track Event <a href="#flow" id="flow"></a>

You may want to use events created in MESA to trigger an action in Klaviyo. Klaviyo allows you to create Flows to connect MESA and Klaviyo together. If you are unfamiliar with Flow, [you can click here to learn more.](https://help.klaviyo.com/hc/en-us/articles/115002774932#create-a-new-flow4)

<figure><img src="/files/UUuzQxfCNPTUzTSrpKy7" alt="Screenshot of the Klaviyo Flows area, switch to Klaviyo to begin including your MESA track events. Spotlight the Flows section."><figcaption></figcaption></figure>

[Once you run a test on your MESA workflow](/workflow-builder/testing.md), your customized event will be under Metric when creating a Flow in Klaviyo.

In Klaviyo, create the flow, and then under Select a trigger, click on Metric in the All triggers tab of the sidebar.

<figure><img src="/files/oIq04UuC4FuR13QG45el" alt="Screenshot of Klaviyo flow creation, Select a trigger panel on the All triggers tab of the sidebar. Spotlight the Metric trigger."><figcaption></figcaption></figure>

Then, scroll to find your customized MESA track event and select it.

<figure><img src="/files/6Om38x3hRY0XhGjCdLiz" alt="Screenshot of the Klaviyo Metric trigger selection, scroll to find your customized MESA track event. Spotlight the MESA track event in the list."><figcaption></figcaption></figure>

#### Use a MESA Track Event in a Klaviyo Conditional Split <a href="#conditional-split" id="conditional-split"></a>

In some cases, you may want to use a MESA track event in a Klaviyo conditional split so that you can add multiple actions depending on whether the condition was satisfied. The following example shows a Klaviyo flow that checks on a fulfilled order after 2 days. If the "A fulfillment has been delivered" event has not occurred at least once since starting the Klaviyo flow, Klaviyo will send a notification.

<figure><img src="/files/qBHEsTwjUYeGutS0bceZ" alt="Screenshot of a Klaviyo flow with a conditional split that checks a fulfilled order after 2 days for the A fulfillment has been delivered event. Spotlight the conditional split."><figcaption></figcaption></figure>

The MESA track event is in the field next to the "Person has" condition in the conditional split (under API).

<figure><img src="/files/NGpfi0Fcfi6ur2beVROz" alt="Screenshot of a Klaviyo conditional split configuration, the field next to the Person has condition under API. Spotlight the MESA track event selection."><figcaption></figcaption></figure>

#### Using Event Variables from MESA's Create Event action <a href="#event-variables" id="event-variables"></a>

You can add event variables from MESA's Create Event action in metric-triggered flow messages. For more information on how to do this, [you can click here](https://help.klaviyo.com/hc/en-us/articles/115002779071-About-Using-Event-Variables-to-Personalize-Flows#01FK12GQZA8853EXPY3NNWC75S).

<figure><img src="/files/ADhqJBBWOQOQhujnrhOr" alt="Screenshot of a Klaviyo metric-triggered flow message using event variables from MESA&#x27;s Create Event action. Spotlight the inserted event variables."><figcaption></figcaption></figure>

1. In a Klaviyo flow, you first need to select the email in which you want to show the dynamic event data. Next, click Edit in the right-hand sidebar.

<figure><img src="/files/y2o3b8Jj3YOZ1mfbJOSE" alt="Screenshot of a Klaviyo flow, select the email in which you want to show the dynamic event data. Spotlight the Edit button in the right-hand sidebar."><figcaption></figcaption></figure>

2. Next, click on Preview & test in the top-right corner.

<figure><img src="/files/fuFYpedURIOJz5ElVGsE" alt="Screenshot of the Klaviyo email editor. Spotlight the Preview &#x26; test button in the top-right corner."><figcaption></figcaption></figure>

3. In the popup window, you will see a recent event that corresponds with the flow's trigger. You will see all data available for that particular event metric. Once you have located the specific data that you are looking for, you can copy the event variable by clicking on the property name.

<figure><img src="/files/XXyCqpwaHn0TWqnkRew9" alt="Screenshot of the Klaviyo Preview &#x26; test popup showing a recent event&#x27;s available data for the metric, click a property name to copy the event variable. Spotlight the property name."><figcaption></figcaption></figure>

4. Then, by editing a Text content block in your email template, you can add the event variable to populate its data when the email is sent.

<figure><img src="/files/FxpSWyzfsALtogH4LHic" alt="Screenshot of a Klaviyo email template Text content block editor, add the event variable to populate its data when the email is sent. Spotlight the Text content block."><figcaption></figcaption></figure>

### Adding and Subscribing to Lists

Klaviyo provides single and double opt-in settings for lists.

If your list is a double opt-in list, subscribers will not be added to the list via the **Subscribe Profile** action until the customer consents to being added to the list.

If consent is not needed, we recommend using the **Add Profile to List** action instead of the **Subscribe Profile** action to automatically add customers to a list.

{% hint style="info" %}
View Klaviyo templates and tutorials [here](https://www.getmesa.com/apps/klaviyo/integrate)!
{% endhint %}
