# Klaviyo

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2Fh4yXy6GssDjM8cj62F6y%2Fimage.png?alt=media&#x26;token=b540486c-2b1d-49fa-ba39-298b87eb16ba" alt=""><figcaption></figcaption></figure>

Klaviyo is an email marketing tool for Shopify merchants, offering personalized campaign creation, customer segmentation based on shopping behavior, and automated email workflows. It helps boost sales and customer engagement directly from Shopify data.

You can check it out here: <https://apps.shopify.com/klaviyo-email-marketing>

Integration benefits:

* **Profile Synchronization:** Effortlessly integrate wholesaler profiles from B2B/Wholesale Solution into Klaviyo. This synchronization ensures your marketing efforts are always up-to-date and targeted.
* **Personalized Communication:** Break away from standard application emails. Utilize Klaviyo to send personalized and impactful notifications to your customers. This approach not only enriches the customer experience but also aligns perfectly with your brand's voice and messaging strategy.

{% hint style="info" %}
The integration is specifically designed for the module Registration Forms
{% endhint %}

To utilize the integration, please follow the below steps:

## 1. Enable the integration

Navigate to the Klaviyo section on the **Integration** tab of the **API & Integration** page, and click **Manage**. A popup will be displayed.

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2Ffj18wKZdmd5yi31Bgzfo%2Fimage.png?alt=media&#x26;token=34368186-d1d0-46eb-91e5-53d7b6f334e2" alt=""><figcaption></figcaption></figure>

Visit the Klaviyo app to obtain your API key. Need help? Check out this detailed guide: <https://help.klaviyo.com/hc/en-us/articles/7423954176283>

Ensuring your API key has 'Full Access' or at least the following scopes

* *Events*
* *Metrics*

Copy and paste your key in the input and tick **Turn on integration** and **SAVE**

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2FwnHEUOcMLbdpcJEF4DCF%2Fimage.png?alt=media&#x26;token=da22164b-1fa3-40f2-8e68-a20b9c33f069" alt=""><figcaption></figcaption></figure>

Congratulations! The integration is now active.

Now that the integration is set up, let's dive into how it enhances your registration process:

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2FwfNlg2ecWB3JC1T5PSCO%2Fimage.png?alt=media&#x26;token=128056a9-359f-4ff9-8636-0c2c2b86ced7" alt=""><figcaption></figcaption></figure>

## 2. Segmenting Wholesalers in Klaviyo

You can segment wholesalers by their information.

### 2.1. Start with Lists & Segments

To segment wholesalers, go to **Audience** > **Lists & segments** and create a new Segment

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2FpWDoN5NOnTdfJ2bog0uP%2Fimage.png?alt=media&#x26;token=0b52e2a7-c80f-4a4c-900a-0fac473cb9f4" alt=""><figcaption></figcaption></figure>

### 2.2. Define Your Segment

In Klaviyo, you have the flexibility to segment wholesalers based on specific criteria, ensuring your marketing efforts are precisely targeted.

In the **Definition** section, you can choose these options:

* *What someone has done (or not done)*
* *Properties about someone*

#### What someone has done (or not done)

There are 4 specific metrics for you to select:

* *RF - Account Approved*. Activated when a wholesaler's profile is approved.
* *RF - Account Rejected*. Triggered by the rejection of a profile.
* *RF - Pending Approval*. Indicates a profile is awaiting approval.
* *RF - Account Invite*. Occurs when an existing store profile requires account confirmation.

{% hint style="info" %}
Consider including profiles in the wholesaler segment if they have an *RF - Account Approved* status *at least once over all time*. This ensures you are targeting actively engaged and verified wholesalers.
{% endhint %}

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2F5V931RQBK3FHRyDAvwg0%2Fimage.png?alt=media&#x26;token=cc465b50-b7e2-4454-9b18-315dff9f7360" alt=""><figcaption></figcaption></figure>

#### Properties about someone

Profiles created through the B2B/Wholesale Solution have custom properties. These properties correspond to the fields submitted in the registration form. For example:

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2F72EaUgaCJ3RpBMnFsIqO%2Fimage.png?alt=media&#x26;token=df5a057b-c242-4203-87e1-45f16322b93c" alt="" width="563"><figcaption></figcaption></figure>

You can use the properties for setting conditions to segment wholesalers

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2FwuxoXagKT3sBpgEDFXzY%2Fimage.png?alt=media&#x26;token=accbb01e-c6cd-4d44-b4d9-b974b36f784b" alt=""><figcaption></figcaption></figure>

Utilize these segmentation options to tailor your marketing and communication strategies, ensuring they resonate with the right audience at the right time.

## 3. Personalized notifications with Klaviyo

Leverage Klaviyo's **Flows** feature to deliver tailored notifications to your wholesalers through email or SMS, ensuring each message is relevant and timely.

### 3.1. Create a flow

Begin by navigating to the **Flows** page within your Klaviyo dashboard. This is where you can manage and create all your automated workflows.

Click **Create flow** button to start the process of setting up a new, customized flow for your marketing needs.

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2FMCfd0JYm8LRPTZBlU8s4%2Fimage.png?alt=media&#x26;token=9f05bd8c-1a33-4e06-83ba-934ca6bd15cd" alt=""><figcaption></figcaption></figure>

Select "**Build your own**" and create flow's name to continue

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2FNlk9ypJmgMBwlgKYj405%2Fimage.png?alt=media&#x26;token=c32db80e-9069-4648-b2ef-e0e5303939b0" alt="" width="375"><figcaption></figcaption></figure>

### 3.2. Select trigger metric

Within a flow, navigate to the **Trigger** section. Choose **Metric** to set the basis of your notification triggers.

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2F082J3HuXpG1cNbCqzC2h%2Fimage.png?alt=media&#x26;token=2da8bd9f-a4ea-44d2-bf9a-51a56851284b" alt=""><figcaption></figcaption></figure>

Select from four key metrics:

* *RF - Account Approved*. Triggered when a wholesaler's profile is approved, ideal for welcome messages.
* *RF - Account Rejected*. Activates upon profile rejection, useful for feedback requests or further instructions.
* *RF - Pending Approval*. Alerts when a profile is under review, keeping wholesalers informed of their status.
* *RF - Account Invite*. Engages profiles that are pre-existing in your store and prompts for account confirmation.

After selecting your triggers, configure the flow's content and frequency.

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2FYoQiIpb2QjQpZ31ZbVZh%2Fimage.png?alt=media&#x26;token=f3e09591-ea61-4e78-937d-8ac8d7b7a4e4" alt="" width="410"><figcaption></figcaption></figure>

## 4. Disable data synchronization to Shopify

In case you choose the option **After registration, the customer will need to be manually approved**, you should disable the option **Sync profiles, profile data, and custom properties from Klaviyo to Shopify**.

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2FvzT2atoZhm7rgjwEwFOj%2Fimage.png?alt=media&#x26;token=2e034def-f2ad-4b84-aa6e-2150efea5317" alt=""><figcaption></figcaption></figure>

If the synchronization option is enabled, the profiles that haven't been approved will appear on the Shopify Admin which conflicts with the approval logic.

To disable the synchronization option, from Klaviyo, go to **Integrations** > **Shopify**.

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2FPmv8VCy97EeLx2XlsM0n%2Fimage.png?alt=media&#x26;token=4d562049-f25e-445d-9613-154e3f5d90c7" alt=""><figcaption></figcaption></figure>

***

We've covered the essential aspects of integrating B2B/Wholesale Solution with Klaviyo. This guide is designed to streamline your marketing efforts and enhance communication with your wholesalers.

If you encounter any challenges or have questions regarding the integration, our support team is ready to assist you. Please don't hesitate to contact us at [**support-sbc@bsscommerce.com**](mailto:support-sbc@bsscommerce.com) or [**Live Chat**](https://go.crisp.chat/chat/embed/?website_id=9f64b5a9-1a02-4190-93b8-8ef56b19f740) for prompt and expert help.

## 5. Insert customer data variables into the Klaviyo email template

When setting up the email template in Klaviyo, you might figure out that you need to insert some customer data into the email body like the customer's last name, first name, company, or address...

Since the customer data will be stored field by field. Each field has its key. And that is what should be added to the email body.&#x20;

Here is the format of data variables: **{{ person|lookup:'*****field\_key*****' }}**

You should replace the ***field\_key*** param with the following keys:

<table><thead><tr><th width="53">No</th><th width="80">Form's field</th><th width="119">Field lable</th><th width="168">Field key</th><th>Data variable</th></tr></thead><tbody><tr><td>1</td><td>Email</td><td><em>any texts</em></td><td>email</td><td>{{ person|lookup:'email' }}</td></tr><tr><td>2</td><td>First name</td><td><em>any texts</em></td><td>first_name</td><td>{{ person|lookup:'first_name' }}</td></tr><tr><td>3</td><td>Last name</td><td><em>any texts</em></td><td>last_name</td><td>{{ person|lookup:'last_name' }}</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-shpf.bsscommerce.com/b2b-wholesale-solution/integration/klaviyo.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
