arrow-bredcrumbs
Table of Content:

Initiating pop-up with a function

Initiating pop-up with a function

This article is for your website support specialist. It will allow you to make a link/button which, when clicked, triggers the Convolo Speed To Lead pop-up. The pop-up is the one that asks you to fill out the form (with the phone number and other relevant information) and promises a callback in X seconds.

The easiest way to do that is to use the API function window.leadCM.open(). It will trigger the pop-up to show on the screen. Below are basic instructions on how to do it. You should be able to adapt it to your own website code.

  • For buttons:

<button>OPEN</button> // add an attribute 
<button onclick="window.leadCM.open();">OPEN</button>

  • For links:

    • Adding it to one particular link tag:

      <a href = "#" onclick = "window.leadCM.open();" > OPEN </a>

    • It's also possible to assign to existing element using JS snippet with addEventListener method:

      <div><br class="Apple-interchange-newline"> document.querySelector("#myButtonId") .addEventListener("click", function() { if (window.leadCM.open) window.leadCM.open(); });</div>

    • To assign popup to links <a href="#callback" ..>, it is possible to use a snippet as well:

      document.querySelectorAll('a[href="#callback"]')
      .forEach(el => el.addEventListener("click", function() {
      if (window.leadCM.open) window.leadCM.open();
      }));

If you have any questions, please email us at support@convolo.ai

Read next:
Initiating pop-up with a function