Custom Klaviyo Event Signup Form
Created a dedicated Shopify page for Klaviyo signup forms used for events. I also added custom JavaScript so the correct form opens directly from the page.
The Klaviyo Form Had a Delay
The signup forms were created in Klaviyo and used for different events. The default popup behavior was not ideal for this type of event signup.
The Problem
Visitors had to wait for the Klaviyo popup to appear. For event registration, I wanted the signup form to be available right away.
The Solution
I created a custom Shopify page template and used JavaScript to open the Klaviyo form directly instead of waiting for the normal popup trigger.
How I Set It Up
I kept the existing Klaviyo forms and connected them to a custom Shopify page.
- Created a custom Shopify page template.
- Added the Klaviyo form to the page.
- Added JavaScript to open the form.
- Used the event name in the URL to choose the correct form.
- Tested the different event forms.
Tools Used
Simple Setup
The URL tells the script which Klaviyo form should be opened.
JavaScript Used
The script checks the event name in the URL and opens the matching Klaviyo form.
document.addEventListener("DOMContentLoaded", function() {
```
const urlParams = new URLSearchParams(window.location.search);
const event = urlParams.get("event");
window._klOnsite = window._klOnsite || [];
if (event === "dti") {
window._klOnsite.push(['openForm', 'UKUJt5']);
}
if (event === "women") {
window._klOnsite.push(['openForm', 'T8gRAu']);
}
if (event === "greenhills") {
window._klOnsite.push(['openForm', 'WVPTyU']);
}
});
```
Each event has its own Klaviyo form ID. The script checks the URL and opens the correct form.
Easier Event Signup
The event signup forms could be opened directly from a dedicated Shopify page instead of waiting for the normal popup behavior.
The setup also allowed different event links to open different Klaviyo forms.
What I Worked On
Shopify
Created a custom page template for the event signup page.
Klaviyo
Used existing Klaviyo forms for event registration.
JavaScript
Added simple logic to open the correct form.
Problem Solving
Found a simple way to work around the default popup behavior.
More Shopify Projects
See more of my Shopify, Klaviyo, CRO, and custom-code work.
← Back to Projects