---
title: How to connect the JS widget to Leadpages
slug: how-to-connect-the-js-widget-to-leadpages
docTags: 
createdAt: 2023-12-20T20:45:29.800Z
---

### Step 1. In mailfloss, go to Apps & Plugins, click Install JavaScript widget, and add your domain under Whitelist your domains.

![](https://api.archbee.com/api/optimize/yGUejq6E8IJ_sYX6JSjSr/j6al_ljL1cOEbxYxcluMu_step-1-whitelist-your-domain.png)

### Step 2. Copy your JS widget code, along with your public key.

![](https://api.archbee.com/api/optimize/yGUejq6E8IJ_sYX6JSjSr/GuRXo3OQe7D9u8gbPQIAe_step-2-copy-the-html-embed-code-highlighted.png)

### Step 3. From your Leadpages dashboard, go to the left panel and click on "Conversion Tools". Select between "Pop-Ups" or "Alert Bars" depending on your content.

::Image[]{src="https://api.archbee.com/api/optimize/yGUejq6E8IJ_sYX6JSjSr/sPZBmkz3I1_eWXFOedBBU_1.png" size="44" width="265" height="569" position="center" darkWidth="265" darkHeight="569" showCaption="false"}

### Step 4. Select the tool you want to add the widget to.

![](https://api.archbee.com/api/optimize/yGUejq6E8IJ_sYX6JSjSr/xyFO7y3DzlMqEBAWI-4cu_2.png)

### Step 5. Once there, click on "Settings" at the left side of your screen, and paste your code in the "Immediately before the closing \</body> tag" field. 

### Don't forget to save your changes!

::Image[]{src="https://api.archbee.com/api/optimize/yGUejq6E8IJ_sYX6JSjSr/PeSgttTv9Tl1t1s5x0aQf_3.png" size="54" width="473" height="720" position="center" showCaption="false"}

