Site icon Email Uplers

How to Embed Klaviyo Sign-up Forms – The Complete Guide

While embedding a sign-up form on your website is important, the very thought of having to deal with HTML code can be a bit daunting. 

You don’t want to be dealing with code and that’s fair. 

That’s why we’re here. To help you navigate the process of embedding a sign-up form on your website. In this guide, you’ll learn how to do it on Klaviyo. We are certified Klaviyo experts, specializing in Klaviyo consulting for over a decade now. So we know the platform from stem to stern. Let’s go!

(Par for the course, we will be dealing with some code. But we will explain every bit of it so that you don’t need to twist your brains.)

How to Embed Klaviyo Sign-up Forms: The Steps

1. Add Klaviyo’s Onsite JavaScript

In the first step, you’ll have to add Klaviyo’s onsite JavaScript known as Klaviyo.js. 

Why? Because Klaviyo.js establishes the link between Klaviyo’s servers and your website. So when a user submits the form, it is this piece of code that captures the data and sends it to Klaviyo for processing and storage. 

This is how the code reads:

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

Decoding the code:

In short, the above code is what facilitates the actual liaison between your website and Klaviyo. Follow these steps to add it to your website: 

2. Add the Embed Code to Your Website

The next step is adding the embed code to your site.

Now, what’s an embed code? An embed code is a piece of HTML code that allows you to integrate content from another website into your own. For example, if you want to embed a YouTube video in a blog post, you copy the video embed code and paste it where you want the video to appear. That’s how it works for sign-up forms.

Klaviyo will generate the embed code. Copy it from their Publish Form modal.

That done, go to your online store and locate the sign-up form. This is an important step for two reasons:

If that sounded a bit vague, don’t worry! It will be clear in the next steps.

In this step and following, you’ll learn how to navigate to the exact .html file where you need to paste the code you copied in the previous step. 

First, go to Storefront and select My Themes

Select Edit Theme Files as shown in the following image. 

4. Locate the Form Code 

Now, here’s where knowing the form location will help you. 

If, for example, your subscription form appears in the website footer, you need to open the file corresponding to that location. 

So you’ll have to open the footer.html file in Klaviyo’s editor. 

Just press Ctrl+F and type ‘newsletter’ in the Find bar as shown. The highlighted portion is the newsletter code.  

Decoding the code: 

5. Find the Reference to Your Sign-up Form

You’ve successfully located the form code. 

Now look for the exact reference to your subscription form. As shown below, the form code is not located in the same file.

Select the code snippet to open the subscription.form HTML file. 

6. Replace the Form Code with the Embed Code

In the image below, you can see the components of your sign-up form. Highlight the entire block of code and replace it with the embed code you copied.

Decoding the code:

Now, save your theme files and go back to your Klaviyo account. Ensure that your form has been published. Navigate to your site to view the Klaviyo embedded form. 

Bingo! You just learned how to embed Klaviyo sign-up forms in your website. 

All the above examples used BigCommerce as the e-commerce platform. Let’s also explore how to utilize Klaviyo embed form in Shopify.

Klaviyo Embed Form in Shopify: A Quick Guide

To include a sign-up form in the footer of your Shopify site, follow these steps:

Klaviyo Sign-up Forms: Best Practices

Instead of a general wrap-up, we leave you with some expert-vetted email signup form best practices:

Navigating ESPs can be tricky. But with experts like us, you’re free to choose ANY ESP to work with and we’d be thrilled to assist you

Next up, learn how to create sign-up forms in Mailchimp and Campaign Monitor.


Exit mobile version