← Back to all products
$19
CTA Optimizer
CTA optimization toolkit with button text testing, placement analysis, and click-through tracking.
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
cta-optimizer/
├── LICENSE
├── README.md
├── examples/
│ └── cta_config.json
├── free-sample.zip
├── guide/
│ ├── 01_features.md
│ ├── 02_cli-reference.md
│ └── 03_examples.md
├── index.html
└── src/
└── cta_optimizer.py
📖 Documentation Preview README excerpt
CTA Optimizer
Part of the Landing Lab by CodeVault
Analyze and optimize your Call-to-Action buttons. Scores CTA text for action-word strength, measures colour contrast against WCAG accessibility standards, evaluates button placement, and benchmarks click-through rates against industry averages.
Features
- CTA text scoring: power words, weak words, length, verb-first, personalisation
- WCAG 2.1 colour contrast checking (AA and AAA compliance)
- Button placement evaluation across 10 common zones
- Industry CTR benchmarking (SaaS, e-commerce, lead gen, newsletter)
- Overall weighted score with grade (0-100)
- Config file or inline CLI mode
- Text and JSON report output
- Python stdlib only — zero pip dependencies
Quick Start
# Analyze a CTA from a config file
python src/cta_optimizer.py --config examples/cta_config.json --analyze
# Quick inline analysis
python src/cta_optimizer.py --text "Start My Free Trial" --bg-color "#FF6B00" --fg-color "#FFFFFF"
# Contrast check only
python src/cta_optimizer.py --text "Sign Up" --bg-color "#FFAB00" --fg-color "#000000" --contrast-only
# JSON output
python src/cta_optimizer.py --config examples/cta_config.json --format json
CLI Reference
| Flag | Description |
|---|---|
--config, -c | Path to CTA config JSON file |
--text, -t | CTA button text to analyze |
--bg-color | Button background colour (hex, default: #FF6B00) |
--fg-color | Button text colour (hex, default: #FFFFFF) |
--page-bg | Page background colour (hex, default: #FFFFFF) |
--placement | Button placement zone (default: above-fold) |
--industry | Industry for benchmarks: saas, ecommerce, lead_gen, newsletter, general |
--ctr | Current CTR percentage (for benchmarking) |
--analyze | Run full analysis |
--contrast-only | Only check colour contrast |
--format, -f | Output format: text or json |
--verbose, -v | Enable verbose logging |
Configuration
See examples/cta_config.json for a complete example.
Examples
Compare two CTA variations:
python src/cta_optimizer.py --text "Submit" --placement footer
python src/cta_optimizer.py --text "Start My Free Trial Now" --placement hero
*... continues with setup instructions, usage examples, and more.*
📄 Code Sample .py preview
src/cta_optimizer.py
#!/usr/bin/env python3
"""
CTA Optimizer — Landing Lab by DataNest
Analyze and optimize your Call-to-Action buttons. Scores CTA text for
action-word strength, measures color contrast against WCAG standards,
evaluates button placement positions, and benchmarks click-through
rates against industry averages.
Why this exists:
Your CTA button is the single most important element on your landing
page. The difference between "Submit" and "Start My Free Trial" can
be a 30% lift in conversions. This tool gives you data-backed
recommendations instead of guesswork.
Usage:
python cta_optimizer.py --config cta.json --analyze
python cta_optimizer.py --text "Get Started Now" --bg-color "#FF6B00" --fg-color "#FFFFFF"
python cta_optimizer.py --config cta.json --format json
License: MIT
"""
from __future__ import annotations
import argparse
import json
import logging
import math
import re
import sys
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any
# ---------------------------------------------------------------------------
# Constants
# ---------------------------------------------------------------------------
LOG = logging.getLogger("cta-optimizer")
# Words that create urgency and drive action — ranked by effectiveness
# based on marketing research and conversion rate optimisation studies
POWER_WORDS: dict[str, int] = {
"free": 10, "now": 9, "instant": 9, "today": 8, "get": 8,
"start": 8, "try": 8, "save": 7, "discover": 7, "unlock": 7,
"claim": 7, "grab": 7, "join": 6, "learn": 6, "boost": 6,
"launch": 6, "build": 6, "create": 6, "download": 5, "access": 5,
"explore": 5, "upgrade": 5, "grow": 5, "new": 4, "easy": 4,
"fast": 4, "quick": 4, "simple": 4, "exclusive": 4, "limited": 4,
# ... 540 more lines ...