Skip to content

Zortex-Tech-Solutions/Landing-page-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Landing Page Generator with A/B Testing

A professional Python-based landing page generator featuring built-in A/B testing capabilities. Create, test, and optimize your landing pages with real-time analytics.

Python Flask License

✨ Features

  • Visual Editor Interface - Intuitive controls for customizing both A/B test variants
  • Real-time A/B Testing - Automatic 50/50 traffic split between variants
  • Analytics Dashboard - Track views, clicks, and conversion rates in real-time
  • Live Preview - See how your landing pages look before deployment
  • Export Ready Code - Download production-ready Python Flask application
  • Responsive Design - Mobile-friendly landing pages
  • Modern UI - Sleek black design with orange highlights

🎯 What is A/B Testing?

A/B testing (also known as split testing) is a method of comparing two versions of a webpage to determine which one performs better. Visitors are randomly shown either version A or version B, and their interactions are tracked to identify the most effective design.

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

  • Python 3.7 or higher
  • pip (Python package installer)

πŸ”§ Installation

  1. Clone the repository

    git clone https://github.com/SYOP200/landing-page-generator.git
    cd landing-page-generator
  2. Create a virtual environment (recommended)

    python -m venv venv
    
    # On Windows
    venv\Scripts\activate
    
    # On macOS/Linux
    source venv/bin/activate
  3. Install dependencies

    pip install flask

πŸš€ Quick Start

  1. Run the application

    python landing_page_ab_test.py
  2. Open your browser Navigate to http://localhost:5000

  3. View analytics Visit http://localhost:5000/analytics to see real-time test results

πŸ“ Project Structure

landing-page-generator/
β”‚
β”œβ”€β”€ landing_page_ab_test.py    # Main Flask application
β”œβ”€β”€ README.md                    # This file
└── requirements.txt             # Python dependencies

🎨 Customization

Editing Variants

Open landing_page_ab_test.py and modify the variants dictionary:

variants = {
    'A': {
        'headline': 'Your Custom Headline',
        'subheadline': 'Your custom subheadline',
        'cta_text': 'Click Here',
        'cta_color': '#ff6b35'
    },
    'B': {
        'headline': 'Alternative Headline',
        'subheadline': 'Different subheadline',
        'cta_text': 'Get Started',
        'cta_color': '#ff8c42'
    }
}

Changing Traffic Split

By default, traffic is split 50/50. To change this, modify the landing_page() function:

# For 70/30 split (70% A, 30% B)
variant = random.choices(['A', 'B'], weights=[70, 30])[0]

πŸ“Š Understanding the Analytics

The analytics endpoint (/analytics) returns JSON data with:

  • views - Total number of page views for each variant
  • clicks - Number of CTA button clicks
  • conversion_rate - Percentage of visitors who clicked (clicks/views Γ— 100)

Example response:

{
  "A": {
    "views": 1247,
    "clicks": 156,
    "conversion_rate": 12.51
  },
  "B": {
    "views": 1198,
    "clicks": 189,
    "conversion_rate": 15.78
  }
}

πŸ” Production Deployment

For production use, consider:

  1. Use a production WSGI server

    pip install gunicorn
    gunicorn -w 4 -b 0.0.0.0:5000 landing_page_ab_test:app
  2. Add a database - Store analytics in PostgreSQL, MySQL, or SQLite instead of in-memory storage

  3. Implement session tracking - Use cookies or sessions to ensure users see consistent variants

  4. Add environment variables - Store configuration in .env files

  5. Enable HTTPS - Use SSL certificates for secure connections

πŸ› οΈ Advanced Features

Adding More Variants

Extend the system to test 3+ variants:

variants = {
    'A': {...},
    'B': {...},
    'C': {...}
}

variant = random.choice(['A', 'B', 'C'])

Statistical Significance

For reliable results, ensure:

  • Minimum 100 conversions per variant
  • At least 1-2 weeks of testing
  • Consistent traffic patterns

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ› Troubleshooting

Port Already in Use

If port 5000 is already in use:

app.run(debug=True, host='0.0.0.0', port=8080)

Analytics Not Updating

Make sure you're making actual page visits and clicking the CTA button. Refresh the /analytics endpoint to see updates.

Module Not Found Error

Ensure Flask is installed in your active Python environment:

pip list | grep Flask

πŸ“š Additional Resources

πŸ‘¨β€πŸ’» Author

SYOP200 - @SYOP200

Project Link: https://github.com/SYOP200/landing-page-generator

πŸ™ Acknowledgments

  • Flask framework for the backend
  • Modern web design principles
  • A/B testing methodologies

Made with ❀️ and Python

About

Python-based landing page generator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published