Docs / Add popups to your own website
Add popups to your own website
Already have a website on WordPress, Shopify, Webflow, Wix, or anything else? Build popups in DearConvert and show them there with one script tag. Forms work, leads land in your DearConvert inbox, and once the script is in, you change, publish, and pause popups without touching your site again.
1. Create a popup site
In the dashboard, go to Sites, click New site, and
choose Popups for my website. Name it and enter your website's
address, like example.com. This kind of site has no hosted pages - it
holds the popups for the website you already have.
2. Build and publish a popup
Under Popups, click New popup, start from a template, and pick the layout, trigger, and frequency - Launch a popup site-wide walks through each one. Under Targeting, choose which pages of your website show it:
- Every page - the default.
- Only matching pages - for example, URL starts with
/blog. - All except matching - for example, URL contains
/checkout, so buyers are never interrupted.
Rules can match a URL that contains, starts with, or is exactly a value. Then click Publish.
3. Copy your snippet
On the site's page, the Install on your website card shows your snippet. It looks like this, with your own key:
<script async src="https://embed.dearconvert.com/v1/your-key.js"></script>
You install it once. When you publish a popup, publish it again after editing, or pause it, your site picks up the change within a minute - the snippet stays the same. It loads asynchronously, so it never holds up your page.
4. Paste it on your website
Add it just before </body> on every page. On the common
platforms:
- HTML - paste it before
</body>on every page, or once in the footer template your pages share. - WordPress - install a header & footer plugin such as WPCode. Open Code Snippets → Header & Footer, paste the snippet into the Footer box, and save.
- Shopify - go to Online Store → Themes, click … next to
your theme → Edit code. Open
theme.liquid, paste the snippet just before</body>, and save. - Webflow - open Site settings → Custom code and paste the snippet into Footer code. Save, then publish your site. Custom code needs a paid Webflow site plan.
- Wix - go to Settings → Custom code → Add Custom Code. Paste the snippet, choose All pages, place it in Body - end, and apply. Needs a Wix Premium plan with a connected domain.
- Google Tag Manager - add a Custom HTML tag, paste the snippet, set the trigger to All Pages, save, then Submit to publish the container.
5. Check it's working
Open your website, then look at Your websites on the install card. Once the script has loaded, your domain changes from Not detected yet to Live · last seen.
To see a popup straight away, open the popup's … menu and choose Preview on example.com (with your domain). Your site opens with the popup showing immediately, whatever its trigger or frequency, and the preview doesn't count in your stats.
Your websites and subdomains
The script only runs on the domains in your list, so nobody can copy your snippet
onto another site. If you entered your website's address when creating the site,
it's already there. One entry covers every subdomain: example.com also covers
www.example.com and shop.example.com. To add another
website, paste its domain or any URL from it under Your websites.
If the script turns up on a domain that isn't in your list, the card tells you and offers to add it.
| Plan | Free | Starter | Pro | Agency |
|---|---|---|---|---|
| Websites with the script | 1 | 1 | 3 | Unlimited |
| Live popups | 1 | 3 | Unlimited | Unlimited |
Both limits apply across your whole account. Paused and draft popups don't count. On the Free plan, popups carry a small "Popup by DearConvert" link. See pricing.
Where the leads go
Popup form submissions land in Submissions, labelled with the popup's name, and go to your email notifications and integrations just like page leads. They count toward your monthly leads the same way. Each popup also shows how many visitors saw it and how many converted.
Open a popup from your own buttons
Set the popup's trigger to On click and enter a CSS selector, such
as .newsletter-button - clicking any matching element opens it. Or add
the data-dearconvert-popup attribute from the popup's settings to any
button or link; that works whatever the trigger is:
<button data-dearconvert-popup="YOUR-POPUP-ID">Get the guide</button>
For developers: the JavaScript API
Once the script has loaded, window.DearConvert can open and close
popups. The popup ID is the value of its data-dearconvert-popup
attribute.
DearConvert.open("YOUR-POPUP-ID");
DearConvert.close("YOUR-POPUP-ID");
To send popup activity to your own analytics, listen for the
dearconvert:show, dearconvert:close, and
dearconvert:submit events. They fire on window, so the
listener works even if it runs before the script has loaded:
window.addEventListener("dearconvert:submit", function (e) {
// e.detail = { popupId, name, formId, submissionId }
gtag("event", "generate_lead", { popup: e.detail.name });
});
The show and close events carry popupId and
name.
Troubleshooting
- Nothing shows. Check that the popup is published and that your domain is in Your websites. Then check its targeting: device, page rules, and frequency. A popup set to show once won't show again in a browser that has already seen it, so use the preview link or a private window.
- A change hasn't appeared. Edits to a live popup go out when you click Publish again. Give it a minute, then reload your site.
- It looks different from the editor. It shouldn't: popups render in an isolated layer, so your site's styles can't change them and they can't change your site. If something is off, tell us with the page URL.
- Your site sends a Content-Security-Policy header. Most sites
don't. If yours does, allow
https://embed.dearconvert.cominscript-srcandconnect-src,'unsafe-inline'instyle-src,fonts.googleapis.comandfonts.gstatic.comfor fonts, and the image host your popups use.