How can i capture leads from external websites,social medias, Google into ERPNext?
There are a few different ways to do this depending on your setup. Here’s what works well in practice:
1. Frappe Web Form (simplest)
If your website is built on Frappe/ERPNext itself, just create a Web Form linked to the Lead doctype. It auto-creates leads on submission with no extra code. Works great for contact us / enquiry forms.
2. REST API (for external websites)
For websites built outside Frappe (WordPress, React, etc.), use the ERPNext REST API to create leads directly:
POST /api/resource/Lead
Authorization: token api_key:api_secret
Content-Type: application/json
{
"lead_name": "John Doe",
"email_id": "john@example.com",
"mobile_no": "+1234567890",
"source": "Website"
}
Generate an API key from User settings in ERPNext and use it in your form’s submit handler.
3. Google Ads / Facebook Leads
For social media lead forms (Google Lead Form, Facebook Lead Ads), the cleanest approach is to use n8n or Zapier as a middleware:
- Google Ads Lead → n8n → ERPNext REST API → Lead created
- Facebook Lead Ad → n8n → ERPNext REST API → Lead created
n8n has native ERPNext nodes so this is pretty straightforward to set up without coding.
4. Email-to-Lead
Another option is to configure ERPNext Email Accounts to auto-create Leads from incoming emails useful if your social ad forms send leads via email.
Which channel are you primarily targeting website forms, Google Ads, or social media? Happy to go deeper on whichever one fits your setup.
Thank you so much for taking the time to go through my query and providing such a clear and helpful explanation. I truly appreciate your support and guidance. I will definitely try this out and see how it works. Thanks again for your help.