---
title: How to connect the JS Widget to OptinMonster
slug: how-to-connect-the-js-widget-to-optinmonster
docTags: 
createdAt: 2023-12-20T20:45:25.569Z
---

## 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)

## 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)

## 3. From your Campaign Dashboard at OptinMonster, select the site you want to add the widget to and click on "Edit Campaign".

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

## 4. Go to your blocks and select the HTML one. Drag it right below your input block.

![](https://api.archbee.com/api/optimize/yGUejq6E8IJ_sYX6JSjSr/PlSgJIQoNquTvWFjgY9_M_4.png)

## 5. Paste your widget code into the HTML editor and save your changes.

![](https://api.archbee.com/api/optimize/yGUejq6E8IJ_sYX6JSjSr/0QsfrFB8HwDB5jWv2ESBU_5.png)

