How to Connect GitHub Pages Forms to Form2Lead
Step-by-step developer instructions for GitHub Pages applications.
How do you send GitHub Pages form submissions to Form2Lead?
Get a working contact form on a GitHub Pages site by pointing your HTML form action at a Form2Lead endpoint — Pages has no server, and Form2Lead is the server.
Why use Form2Lead with GitHub Pages?
GitHub Pages serves static files only — there is no backend to receive form submissions, no PHP, no serverless functions. Form2Lead is the standard fix: set your form action to a Form2Lead URL, add your `*.github.io` origin to Allowed Domains, and submissions arrive by email and in the dashboard. Works for Jekyll, plain HTML, and any static generator that publishes to Pages.
Prerequisites
- ✔A GitHub Pages site
- ✔A Form2Lead endpoint URL
Step-by-Step Integration Guide
01. Point the Form Action at Form2Lead
Set your form element’s action attribute to your Form2Lead URL and keep method POST.
<form action="https://form2lead.com/api/v1/f/YOUR_FORM_ID" method="POST"> <input type="text" name="name" placeholder="Name" required /> <input type="email" name="email" placeholder="Email" required /> <textarea name="message" placeholder="Message" required></textarea> <button type="submit">Send</button> </form>
02. Allow Your GitHub Pages Origin
Add `yourusername.github.io` (and your custom domain, if any) to the form’s Allowed Domains list in Form2Lead.
03. Add the Honeypot Spam Field
Include a hidden `_gotcha` input so automated bots are silently dropped.
<input type="text" name="_gotcha" style="display:none !important" tabindex="-1" autocomplete="off" />
GitHub Pages Integration FAQ
Why does my GitHub Pages form submission fail without Form2Lead?
GitHub Pages serves static assets only — POST requests have no server to reach. A 405 is normal. Pointing the form at a Form2Lead endpoint sends submissions to a real backend instead.