Router installation

Install the router on your website with a Distro-provided code snippet to activate lead management and scheduling features.

After configuring your router in Distro, the final step to fully integrate this system into your lead management process is to install the router in your website. This involves implementing a code snippet that links your website’s functionality with the Distro system. This critical step ensures that the lead routing, qualification, and scheduling features are active and functioning seamlessly on your site.

Installing the Router: A Simple Process

  1. Obtain the Router Code Snippet:

After finalizing the setup of your router in the Distro platform, you will be provided with a unique code snippet. This code is the key element that connects your website's lead generation forms and interfaces with the Distro system.

Go to your Routers, select the desired router, and then click on "Install Router."

  1. Follow the specific steps of the form you are using:

Supported forms

Install the router on your website

You can install the router as:

  • A popup

  • From the click of an element

  • As an embed

You need to first obtain the code snippet from the Install Router page of your router.

Then add the following script tag to the <head> of your page.

Then paste the rest of the javascript snippet before the closing tag of the <body> element.

Thats'it!

From the click of an element

Here is an example of how you can adapt the above code to trigger the popup from a button.

You will need to pass key value pairs to the submit() function. e.g. if you want to pass the email and name.

// Trigger the popup from a button or link
<script type="text/javascript">
    const btn = document.getElementById('btn')
    console.log(btn)
    btn.addEventListener('click', () => {
      const distro = new Distro({ routerId: '213' }) // replace the router id

      distro.submit({
        field: 'value' // email: 'test@distro.so'
      }).then((data) => {
        console.log(data)
        distro.dialog.open(data);
      }).catch((error) => {
        console.log(error)
      })
    })  
</script>

From an embed

You can open the popup directly inside a selected div once the form has been submitted. All you need to do is to specify the id of the target div.

<script type="text/javascript" src="https://app.distro.so/inbound.js"></script>
<script type="text/javascript">
window.distro = new Distro({ routerId: '213' })
distro.schedule('#screendesk-form', '#embedDiv')
</script>

Last updated