Hi @Team WP ! It seems like you're on the right track, but there might be a few things causing the pop-up not to show up as expected.
Here’s a checklist of things you can try to troubleshoot:
1. Correct Form ID: Make sure that the form ID you're using (`Ur4m7Q`) is correct. Double-check this in your Klaviyo account under the forms section.
2. Check Script Placement: Ensure that the `<script>` for triggering the form is placed after the Klaviyo snippet in the HTML, or at least in the footer of your page. This ensures the Klaviyo script loads before the trigger script.
3. JavaScript Console: Open your browser’s developer tools (usually with `F12` or right-click → “Inspect”) and check the Console tab for any error messages. If there are any errors related to the scripts, they will show here.
4. Pop-up Display Settings: Double-check that the form you've created in Klaviyo is set to display on click and is not restricted by any conditions (like device or page type).
5. Test with Simple Button: As a test, try placing a simple `<button>` on the page with a `console.log` action on the click event to make sure the button click is being registered:
```html
<button class="klaviyo_form_trigger">Subscribe</button>
<script type="text/javascript">
document.querySelector('.klaviyo_form_trigger').addEventListener('click', function (){
console.log("Button clicked!");
window._klOnsite = window._klOnsite || [];
window._klOnsite.push(['openForm', 'Ur4m7Q']);
});
</script>
```
If you see the log in the console, it confirms the button click is working correctly.
6. Clear Cache: Sometimes, browser caches can prevent scripts from executing properly. Clear your browser cache or try the page in an incognito window.
Let me know if you need more help!
Whatsapp number +2349028546638