@* Service Cloud * @* Sales Cloud - Best Practices *
Hi All
I'm currently looking to deploy embedded chat in Production. We have created a Pre Chat Form to create a lead.
Can anyone confirm how I can set the Lead Source on the Lead created from the Pre Chat Form?
Hi Brian,
I haven't worked with Pre Chat forms in a couple years, but I think I found a resource that can help. The important part is the hidden input containing the lead source to be set.
http://peterknolle.com/live-agent-pre-chat-api/ Example code (uncompiled and untested)
<!-- Detail inputs -->
First Name: <input type="text" name="liveagent.prechat:leadFirstName" /><br />
Last Name: <input type="text" name="liveagent.prechat:leadLastName" /><br />
Email: <input type="text" name="liveagent.prechat:leadEmail" /><br />
<!-- Hidden input to store Lead Source -->
<input type="hidden" name="liveagent.prechat:leadSrc" value="Chat" />
<!-- Map the detail inputs to the Lead fields -->
<input type="hidden" name="liveagent.prechat.findorcreate.map:Lead" value="FirstName,leadFirstName;LastName,leadLastName;Email,leadEmail;LeadSource,leadSrc;" />
<!-- Try to find the Lead by email (exact match) -->
<input type="hidden" name="liveagent.prechat.findorcreate.map.doFind:Lead" value="Email,true;" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.isExactMatch:Lead" value="Email,true;" />
<!-- If the Lead is not found, then create one with the following fields set -->
<input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Lead" value="FirstName,true;LastName,true;Email,true;LeadSource,true;" />
Let me know if this helps!
Charlie