---
title: "How to add a Klaviyo embed form to your Square Online site"
description: "Learn how to add a Klaviyo embed form to your Square Online site, which requires creating a form in Klaviyo, and then pasting its embed code into your site’s files where you want it to appear (e.g., the footer)."
canonical_url: "https://help.klaviyo.com/hc/en-us/articles/18229698831003"
markdown_url: "https://help.klaviyo.com/hc/en-us/articles/18229698831003.md"
locale: "en-us"
category: "Integrations"
section: "Square"
updated: "2026-10-29"
---

# How to add a Klaviyo embed form to your Square Online site

## You will learn

Learn how to add a Klaviyo embed form to your Square Online site, which requires creating a form in Klaviyo, and then pasting its embed code into your site’s files where you want it to appear (e.g., the footer).

## Before you begin

Before creating an embed form in Klaviyo, make sure you've integrated Klaviyo with Square and set up onsite tracking to enable sign-up form functionality. If you checked the setting **Automatically add Klaviyo onsite javascript (Recommended)** when [integrating with Square](https://help.klaviyo.com/hc/en-us/articles/11117215837211.md), you’re all set. 

If not:

1. In Klaviyo, select the **Integrations** tab.

2. Click on **Square**, then select the **Settings** tab.

3. Check the setting **Automatically add Klaviyo onsite javascript (Recommended)**.

4. Click **Save settings**.



## Add the form's embed code to your site

First, [create and publish your embed form in Klaviyo](https://help.klaviyo.com/hc/en-us/articles/360006897412.md#h_01JFAQY2NGMT87KJ956KJYGFFX). This section will go over the next steps of pasting your form's embed code on your Square Online site so it displays and syncs data properly.

1. Navigate to your Square Online dashboard.

2. Click **Website > Edit Site**.

3. Open the page where you’d like to embed the form.

4. Select **Add Section > Embed code**, then click **Add**.

5. Copy the following onsite JavaScript snippet and paste it into the **Code** box:




```text
<script type="text/javascript" src="https://static.klaviyo.com/onsite/js/PUBLIC_API_KEY/klaviyo.js"></script>
```

1. In the code you just pasted, replace PUBLIC_API_KEY with your [Klaviyo public API key.](https://help.klaviyo.com/hc/en-us/articles/115005062267.md#h_01HRFPP8R1AEVQ744SE33FQTEC)

   - To find your public API key, navigate to **Settings > API keys** in Klaviyo. This is a 6-character code, also referred to as your "account ID."

2. Navigate back to Klaviyo and open your form in the editor. Select **Targeting & behavior > Display**, then copy your form’s code under **Embed code**.



![An example form's embed code highlighted to copy from the Targeting and behaviors tab of the form editor.](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/5a0d28fc4ca9a782c56345a03642af932b4a3a5f-954x758.jpg?auto=format)

3. In Square, paste the embed code in the **Code** box beneath where you pasted the other script in step 5.

4. Select **Done**.

5. Select **Publish** to save your changes.



Once you've pasted the embed code and saved your changes in Square, navigate back to your website and refresh the page. Your embed form will display on your site and add new subscribers directly to the Klaviyo list linked to the form. 

Test the form with a new email address. If the list uses double opt-in, confirm the subscription in the confirmation email. Then check that the new subscriber appears in the list linked to the form in Klaviyo.

If you don't see your form, see [troubleshooting embed forms](https://help.klaviyo.com/hc/en-us/articles/360006897412.md#h_01JFAQY2NHMG3PPV523K4ESXEV). 

**📝 Note:** If you decide to disconnect your Square integration, you will need to manually remove this embed code from the Square Online site editor to remove your form.

## Next steps

Next, [create a welcome series](https://help.klaviyo.com/hc/en-us/articles/115002775172.md) to make an immediate impact on your new subscribers.

## Additional resources

- [Getting started with Square](https://help.klaviyo.com/hc/en-us/articles/11117215837211.md)
  Learn how to easily integrate Klaviyo with your Square Online site in order to sync customer profile, order, and catalog information to Klaviyo, along with order data from your Square Point of Sale (POS). With this data, you’ll be able to reach customers with targeted messaging through segmentation, automated flows, and campaigns. 
- [How to embed a sign-up form on your website](https://help.klaviyo.com/hc/en-us/articles/360006897412.md)
  Learn how to add an embed sign-up form onto a specific page or location of your website (e.g., the footer), so shoppers looking to learn more about your brand can easily sign up. Embedding a sign-up form in the footer of your site to work in tandem with your other published forms is a Klaviyo best practice for optimizing list growth. 
- [How to verify that sign-up forms are enabled](https://help.klaviyo.com/hc/en-us/articles/360002035871.md)
  Learn how to verify that sign-up form functionality is enabled on your website. This makes sure that sign-up forms published in Klaviyo display as expected on your site and sync all necessary data to Klaviyo. 
