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
Hi @Team WP,
Did you manage to figure this out? Ojuade had some good suggestions, and I’d also like to recommend that you double check a couple things. Firstly, is the Klaviyo javascript present in your site’s code? If so, where did you add it? Additionally is the form set to only display on certain pages, in certain locations, or to not show to certain profiles/groups? If so, that may prevent you from seeing the form.
Let me know if you’ve already ruled out these possibilities, and if so, we can continue to troubleshoot this!
-Byrne
Hello there,
all mentioned above is correct.
The pop up is blocked due to some script of my cookie banner, which blocks the execution of the main Klaviyo script
https://espacesetlignes.com/
The pop up should be triggered by the subscribe button at the end of the page