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