GitHub Pages Integration Guide

Complete guide to integrate MyFormConnect with GitHub Pages

Setup time: 10-15 minutes
Difficulty: Easy
Compatible versions: All GitHub Pages sites

Host a static site on GitHub Pages for free and collect form submissions through MyFormConnect. GitHub Pages serves static files — HTML, CSS, and JavaScript — so you cannot run server-side code. MyFormConnect acts as the form backend, storing submissions and sending notifications.

Prerequisites

  • A MyFormConnect account — sign up here
  • A form created in MyFormConnect with the form UUID copied
  • A GitHub account — sign up at github.com
  • Git installed on your computer, or use GitHub's web editor

Integration Methods

Single HTML Page

5 minutes Easy

The simplest approach: one self-contained HTML file with embedded CSS and JavaScript. Suitable for personal portfolios, landing pages, or any project that needs a contact form. Works with both user sites and project sites.

1

Create the HTML file

Create a file called contact.html (or add the form to your index.html). The example below is a complete, standalone contact page — HTML, CSS, and the form all in one file.
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Contact Us</title>
  <style>
    * { box-sizing: border-box; }
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      max-width: 560px;
      margin: 48px auto;
      padding: 0 24px;
      color: #1f2937;
    }
    h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 24px; }
    label {
      display: block;
      font-size: 0.875rem;
      font-weight: 600;
      margin: 16px 0 4px;
    }
    input, textarea {
      width: 100%;
      padding: 10px 12px;
      border: 1px solid #d1d5db;
      border-radius: 6px;
      font-size: 1rem;
      font-family: inherit;
    }
    input:focus, textarea:focus {
      outline: 2px solid #2563eb;
      outline-offset: 1px;
      border-color: transparent;
    }
    textarea { resize: vertical; min-height: 100px; }
    button {
      margin-top: 20px;
      padding: 10px 28px;
      background: #2563eb;
      color: #fff;
      border: none;
      border-radius: 6px;
      font-size: 1rem;
      font-weight: 600;
      cursor: pointer;
    }
    button:hover { background: #1d4ed8; }
  </style>
</head>
<body>
  <h1>Contact Us</h1>

  <form action="https://myformconnect.io/f/YOUR_FORM_UUID" method="POST" data-mfc="true">
    <label for="name">Name *</label>
    <input type="text" id="name" name="name" required>

    <label for="email">Email *</label>
    <input type="email" id="email" name="email" required>

    <label for="message">Message</label>
    <textarea id="message" name="message"></textarea>

    <button type="submit">Send Message</button>
  </form>

  <!-- loader.js adds AJAX submission, loading state, and validation.
       Remove this script tag to use a plain HTML form POST instead. -->
  <script src="https://myformconnect.io/loader.js" data-client-id="YOUR_FORM_UUID"></script>
</body>
</html>
Important Note
Replace both instances of YOUR_FORM_UUID with your actual form UUID from MyFormConnect. The loader.js script is optional — the form works without it as a standard HTML POST.
2

Commit and push to GitHub

Add the file to your repository and push to the branch GitHub Pages is configured to serve.
  1. Place contact.html in your repository root (or in the /docs folder if that is your Pages source)
  2. Commit the file: git add contact.html && git commit -m "Add contact form"
  3. Push: git push origin main
  4. Wait 1-2 minutes for GitHub Pages to build and deploy
Important Note
If you are using GitHub's web editor, click Add file → Create new file, paste the HTML, name it contact.html, and commit directly.
3

Whitelist your GitHub Pages domain in MyFormConnect

MyFormConnect only accepts submissions from domains you have explicitly allowed.
  1. Note your GitHub Pages URL — either https://username.github.io or https://username.github.io/repository-name
  2. Log in to MyFormConnect and open Domains in the dashboard
  3. Add the full URL including protocol (e.g. https://username.github.io)
  4. Save
Important Note
If you later add a custom domain, you will need to add that domain to MyFormConnect as well and can remove the github.io entry.

Next Steps

Configure MyFormConnect

  • Set up your timezone
  • Configure lead notifications
  • Set up advanced spam detection
  • Add team members to your account

Advanced Features

  • Use our custom form templates
  • Try AI Insights for Leads
  • Integrate with your CRM
  • Set up automated workflows

Need Help?

Our support team is here to help you with your integration.

Contact Support