Sub topic 11
Capturing leads and passing them to a CRM
This chapter assumes you know the hub-and-spoke model, can read a basic HTML form, and have seen UTM parameters on campaign links. No programming is required. The code is explained as it appears.
What lead capture does for the hub
A lead is a person who has given you contact details and some permission to follow up. Traffic from search, social and email lands on the website, and a form is where an anonymous visit becomes a known contact. A CRM (customer relationship management system) is the database where those contacts are stored, tracked and followed up. If the form and the CRM are not connected, the leads from every spoke end up in an inbox or spreadsheet where they get lost.
A minimal form
Every extra field lowers the share of visitors who finish the form. Start with the smallest form that lets you follow up. For a free guide, that is an email address.
<form action="/subscribe" method="post">
<label for="email">Email address</label>
<input id="email" name="email" type="email" required>
<button type="submit">Get the free guide</button>
</form>Points to notice:
- The
labelis tied to the field byforandid. This helps screen readers and makes the field easier to tap on mobile. type="email"andrequiredmake the browser check the entry before it is sent. This catches typing mistakes but does not replace checks on the server.- The button text states the benefit. "Get the free guide" tells the visitor what happens next. "Submit" does not.
name="email"is the key your system receives. It is later mapped to a CRM field.
From form to CRM
The path a lead takes has the same steps in most setups.
Most CRMs offer three ways to connect a form:
| Method | How it works | Good for |
|---|---|---|
| Embedded form from the CRM | You paste the CRM's own form code into the page | Fast setup, little control over design |
| Native integration or plugin | Your form tool or site builder pushes data to the CRM | Common platforms, low maintenance |
| API or webhook | Your server sends the data to the CRM when the form is submitted | Custom forms and full control |
Carry the source with the lead
The most useful extra data on a lead is where it came from. When a visitor arrives on a link such as ?utm_source=newsletter&utm_medium=email&utm_campaign=spring_sale, those values can be copied into hidden form fields. They are saved on the CRM record with the email address.
<form action="/subscribe" method="post">
<label for="email">Email address</label>
<input id="email" name="email" type="email" required>
<input type="hidden" name="utm_source" value="newsletter">
<input type="hidden" name="utm_medium" value="email">
<input type="hidden" name="utm_campaign" value="spring_sale">
<button type="submit">Get the free guide</button>
</form>The values above are fixed for the example. In a real page, a small script reads them from the URL and fills the hidden fields. With the source stored, you can later ask which campaign produced customers and not only which produced form fills.
Common errors
- Too many fields. Ask for what you need to make the first contact. You can collect more later.
- No consent record. Store what the visitor agreed to and when. The next chapter covers this.
- Duplicate contacts. Use the email address as the unique key so a repeat visitor updates one record.
- Silent failures. If the CRM connection breaks, the form may still show a thank-you message. Test submissions regularly and set up an alert for failed syncs.
- Lost source data. If the visitor browses to another page before submitting, the UTM values are gone from the URL. Save them in a cookie or session storage on arrival, and note that doing so can require consent.
Test the handoff
- Open your landing page using a tagged link.
- Submit the form with a test address.
- Find the new contact in the CRM.
- Check that the email, the source fields and the timestamp are correct.
- Submit the same address again and confirm it does not create a duplicate.
Exercise
A visitor clicks a tagged newsletter link, reads two other pages, and then submits your form. The CRM record has an empty campaign field. What most likely happened, and how can you fix it?
Show answer
The UTM values were only in the landing page URL. When the visitor moved to other pages they were lost, so the hidden fields were empty at submission. Fix it by saving the UTM values in a cookie or session storage when the visitor first arrives, then filling the hidden fields from that stored copy. Check whether this storage requires consent.
Exercise
Why does the form use type="email" and required if the server must validate the address anyway?
Show answer
Browser checks give the visitor instant feedback and catch typing mistakes, which improves completion. They can be bypassed, so the server must still validate the input before it goes to the CRM.