← Back to all products
$19
Exit Intent Popup
Exit intent detection with configurable popups, email capture, and discount offer delivery.
JSONMarkdownPython
📄 Product Preview
Try the interactive reader and demo tools below, or get the full product with all content unlocked.
📖 Interactive Reader (Free Preview) ⚙ Try Demo Tools 📦 Download Free Sample📁 File Structure 9 files
exit-intent-popup/
├── LICENSE
├── README.md
├── examples/
│ └── popup_config.json
├── free-sample.zip
├── guide/
│ ├── 01_features.md
│ ├── 02_cli-reference.md
│ └── 03_examples.md
├── index.html
└── src/
└── exit_intent_popup.py
📖 Documentation Preview README excerpt
Exit Intent Popup
Part of the Landing Lab by CodeVault
Generate lightweight exit-intent popup HTML for email capture, discount offers, survey prompts, content offers, and social follow prompts. Produces self-contained HTML/CSS/JS snippets (<5KB) that detect when a user is about to leave and display a customisable overlay.
Features
- Five popup types: email capture, discount offer, survey, content offer, social follow
- Exit-intent detection via cursor tracking (mouseout from viewport top)
- Cookie-based "don't show again" with configurable duration
- Countdown timer for discount urgency
- Responsive modal with CSS animation
- Escape key and overlay-click dismissal
- Configurable activation delay and max display count
- Config file or inline CLI mode
- Python stdlib only — zero pip dependencies
Quick Start
# Generate an email capture popup from config
python src/exit_intent_popup.py --config examples/popup_config.json --output popup.html
# Quick inline email capture popup
python src/exit_intent_popup.py --type email-capture --headline "Wait! Get 20% Off" --output popup.html
# Generate a survey popup
python src/exit_intent_popup.py --type survey --config examples/popup_config.json
# List available popup types
python src/exit_intent_popup.py --list-types
CLI Reference
| Flag | Description |
|---|---|
--config, -c | Path to popup config JSON |
--type, -t | Popup type: email-capture, discount-offer, survey, content-offer, social-follow |
--headline | Popup headline text |
--subheadline | Popup subheadline text |
--cta-text | CTA button text |
--brand-color | Brand accent colour (hex) |
--output, -o | Output file |
--list-types | List available popup types |
--verbose, -v | Enable verbose logging |
Configuration
See examples/popup_config.json for a complete example.
Examples
Generate a discount popup with countdown timer:
python src/exit_intent_popup.py --config examples/popup_config.json --type discount-offer --output discount-popup.html
License
... continues with setup instructions, usage examples, and more.
📄 Code Sample .py preview
src/exit_intent_popup.py
#!/usr/bin/env python3
"""
Exit Intent Popup — Landing Lab by DataNest
Generate exit-intent popup HTML for email capture, discount offers, and
survey prompts. Produces self-contained HTML/CSS/JS snippets that detect
when a user is about to leave (mouse moves toward browser chrome) and
display a customisable overlay.
Why this exists:
Exit-intent popups recover 10-15% of abandoning visitors when done
right. But most popup builder plugins are bloated (100KB+ JS) or
require a monthly subscription. This tool generates a lightweight
(<5KB) popup you own forever.
Usage:
python exit_intent_popup.py --config popup.json --output popup.html
python exit_intent_popup.py --type email-capture --headline "Wait! Get 20% Off"
python exit_intent_popup.py --type survey --config survey.json
python exit_intent_popup.py --list-types
License: MIT
"""
from __future__ import annotations
import argparse
import html
import json
import logging
import sys
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any
# ---------------------------------------------------------------------------
# Constants
# ---------------------------------------------------------------------------
LOG = logging.getLogger("exit-intent-popup")
POPUP_TYPES = {
"email-capture": "Email signup form with headline and CTA",
"discount-offer": "Discount code reveal with urgency timer",
"survey": "Quick 1-question survey before leaving",
"content-offer": "Free resource download (lead magnet)",
"social-follow": "Follow us on social media prompt",
}
# Default delay before exit-intent detection activates (milliseconds)
# ... 426 more lines ...