[SalesForce] Determine if Web-To-Lead or API Created A Lead

We have 94% of our lead forms using a custom-programmed "Funnel" for processing our leads.

However, in the Dark Ages when the company was using Web-to-Lead, some of those pages still exist (non-API, using only web-to-lead, which is "secured", haha, by knowing the OrgID).

Long story short:

How can I determine if a Lead came from Web-to-Lead, versus API, versus even just being typed into Salesforce? I see no evidence that this exists, unless we had the foresight to put a variable into our API "funnel" that ONLY the Funnel stamped (and no one "discovered" later), plus that doesn't give me people who were entered via the SF GUI itself.

I haven't even thought about web-to-lead (seriously) in over two years, and just today (re-)realized that it's literally JUST THE OID that is needed for ANYONE to insert into our Org.
Thanks.

Best Answer

so there are a couple of tricks you can do.

Background: you can include custom fields in your web to lead, and use css/html to hide them and or pre populate the data.

so, with that in mind, I like to do the following.

Put the form on the page, with an unpopulated, hidden field called "Web2lead__c" or some such. Strip out the OrgID from the form.

Write a javascript function that populates the form's oid and web2lead__c fields either on the dom's load completion event or on the form's submit button being clicked.

This cuts down on spam, and helps you pre-funnel things by origin.

Related Topic