—
This tutorial will guide you through creating a simple web form to collect leads and automate the process of adding these leads to a Google Sheet using Datalinky and Zapier.
Create an HTML form to collect lead information (name and email).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lead Collection Form</title>
</head>
<body>
<h1>Lead Collection Form</h1>
<form id="leadForm" action="https://your-datalinky-link" method="POST">
<label for="name">Name:</label><br>
<input type="text" id="name" name="name" required><br><br>
<label for="email">Email:</label><br>
<input type="email" id="email" name="email" required><br><br>
<button type="submit">Submit</button>
</form>
<script>
document.getElementById('leadForm').addEventListener('submit', function(event) {
event.preventDefault();
const formData = new FormData(this);
fetch(this.action, {
method: 'POST',
body: formData
}).then(response => {
if(response.ok) {
alert('Lead submitted successfully!');
} else {
alert('Failed to submit lead.');
}
}).catch(error => {
alert('Error: ' + error.message);
});
});
</script>
</body>
</html>
https://your-datalinky-link
in the form’s action
attribute with the actual Datalinky link URL.