Jump to content

Klaviyo problem with pop up on button form (and also embedded form)

Recommended Posts

Hi

I've moved from Mailerlite to Klaviyo recently and am having big problems connecting it with Squarespace.

I have managed to get the initial site wide pop up form to work - so I am getting newsletter subscribers - but today I wanted to add a form that would pop up on a button being clicked. 

This is the code that Klaviyo wanted to be added (the javascript and also the trigger) - I included them in the site header.

The form code is specific to the one I created

 

<script async type="text/javascript" src="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=VRauc3"></script>
<script> document.querySelector('#klaviyo_form_trigger').addEventListener('click',function (){
        var _klOnsite = window._klOnsite || []
        _klOnsite.openForm('UkGnCW')
});
</script>

 

However, when I add a button block, nothing happens. It just loops the page.

I have tried checking from a private browser page, I have tried adding the code in the footer - I've tried everything I can think of. It seems like Klaviyo and Squarespace REALLY don't play well together but it makes no sense since the first form - the newsletter one - was so easy.

 

I'm really fed up. I contacted both support services, removed a bunch of CSS, tidied up the custom code injection and nothing works.

I would really appreciate some help

Link to comment
  • Replies 1
  • Views 198
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

11 hours ago, sjksanders said:

Hi

I've moved from Mailerlite to Klaviyo recently and am having big problems connecting it with Squarespace.

I have managed to get the initial site wide pop up form to work - so I am getting newsletter subscribers - but today I wanted to add a form that would pop up on a button being clicked. 

This is the code that Klaviyo wanted to be added (the javascript and also the trigger) - I included them in the site header.

The form code is specific to the one I created

 

<script async type="text/javascript" src="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=VRauc3"></script>
<script> document.querySelector('#klaviyo_form_trigger').addEventListener('click',function (){
        var _klOnsite = window._klOnsite || []
        _klOnsite.openForm('UkGnCW')
});
</script>

 

However, when I add a button block, nothing happens. It just loops the page.

I have tried checking from a private browser page, I have tried adding the code in the footer - I've tried everything I can think of. It seems like Klaviyo and Squarespace REALLY don't play well together but it makes no sense since the first form - the newsletter one - was so easy.

 

I'm really fed up. I contacted both support services, removed a bunch of CSS, tidied up the custom code injection and nothing works.

I would really appreciate some help

Can you share you URL so I can check it?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.