Skip to main content

 

 

Hi Klaviyo Support Team,

I’ve encountered an issue where forms set to display “Only on a custom trigger” no longer open, even when triggered via JavaScript as described in your documentation:
https://help.klaviyo.com/hc/en-us/articles/4418052317339

To isolate the problem, I created a test page in Shopify and a new test form in Klaviyo. Even with the simplest example code below, the popup does not appear when clicking the button:

<p>Hello123</p>
<button class="klaviyo_form_trigger">Request Quote123</button>
<script>
document.querySelector('.klaviyo_form_trigger').addEventListener('click', function() {
window._klOnsite = window._klOnsite || [];
window._klOnsite.push(['openForm', 'TjyPf4']);
});
</script>

However, if the same form is set to “Immediately” or “Based on rules”, it opens correctly.
Only the “Only on a custom trigger” option fails to trigger the popup.

Our website has been relying on this setup for a long time and it has always worked well until recently.

Could you please confirm whether there were any recent updates that might have affected the custom trigger functionality?

Thank you very much for your help.

Best regards,

Ethan

 

The test page and the test form

 

The production page, form and code:

 

@Ethan Y the most basic question I will ask is whether the javascript console is displaying anything when the button click occurs.

Also if you executed the below manually does it work?

window._klOnsite = window._klOnsite || [];
window._klOnsite.push(['openForm', 'TjyPf4']);

The only other helpful tip is have you add a console.log statement for the trigger function to ensure its executing after the button click.

 

 


Hi,

 

Everything now is suddenly working poerfectly again this morning.

Last night, I even created a new Shopify store and a new Klaviyo account for testing with the simplest code, and they showed the same issue as my live site.

Now thery are working all right.

 

Thanks